He estado tratando de diseñar un diseño de hardware simple para controlar otra placa que alimente un conjunto de LED para un sistema de iluminación de tambor de escenario. No puedo, por mi vida, averiguar por qué recibo estas advertencias
En resumen, lo que estoy tratando de hacer aquí es crear un diseño que cambie el color de las luces cada vez que se golpee el tambor de la base (BaseBeat), con un tiempo de transición máximo de 1 cambio de luz por segundo (estoy usando un reloj de 50 MHz) así que utilicé un contador qtemp para contar y luego reiniciar después de presionar el BaseBeat) He probado tanto el TB como el diseño en mi Spartan3e, pero no pasa nada (cuando elimino algo relacionado con el reloj y el límite de transición de un segundo funciona).
También, hasta ahora he tomado un curso sobre diseño de VHDL y FPGA, tomaré más esta primavera, pero espero que funcione para poder configurar el sistema de iluminación antes.
estas son las advertencias
WARNING:Xst:646 - Signal is assigned but never used. This unconnected signal will be trimmed during the optimization process. WARNING:PhysDesignRules:367 - The signal is incomplete. The signal does not drive any load pins in the design. WARNING:Par:288 - The signal clk_IBUF has no load. PAR will not attempt to route this signal. WARNING:Par:283 - There are 1 loadless signals in this design. This design will cause Bitgen to issue DRC warnings.
(la advertencia next_color no parece ser mi problema principal, aunque podría estar equivocado)
Aquí está mi código:
entity LEDcontroller is
port( BaseBeat: in STD_LOGIC;
output,ON_BOARD_LED_output: out STD_LOGIC_VECTOR(2 downto 0);
color_scheme: in STD_LOGIC_VECTOR(1 downto 0);
ON_BOARD_LED_color_scheme: out STD_LOGIC_VECTOR(1 downto 0);
ON_BOARD_LED_BaseBeat: out STD_LOGIC;
ON_BOARD_LED_ONEsec_flag: out STD_LOGIC;
clk : in STD_LOGIC);
end LEDcontroller;
architecture controller_behavior of LEDcontroller is
type color_type is (RED, YELLOW, GREEN, TURQOISE, BLUE, PINK, WHITE, OFF);
signal current_color: color_type := OFF;
signal next_color: color_type := OFF;
signal outputTEMP: STD_LOGIC_VECTOR(2 downto 0); -- default is off
signal qtemp: STD_LOGIC_VECTOR(24 downto 0);
signal ONEsec_flag: STD_LOGIC;
begin
process(clk)
begin
if (clk'event and clk='1') then
qtemp <= qtemp + 1;
end if;
end process;
sequence: process(current_color,color_scheme)
begin
if (color_scheme = "00") then
case current_color is
when RED => next_color <= GREEN;
when GREEN => next_color <= BLUE;
when BLUE => next_color <= RED;
when OTHERS => next_color <= RED;
end case;
elsif (color_scheme = "01") then
case current_color is
when RED => next_color <= YELLOW;
when YELLOW => next_color <= GREEN;
when GREEN => next_color <= TURQOISE;
when TURQOISE => next_color <= BLUE;
when BLUE => next_color <= PINK;
when PINK => next_color <= RED;
when OTHERS => next_color <= RED;
end case;
elsif (color_scheme = "10") then
case current_color is
when RED => next_color <= PINK;
when PINK => next_color <= BLUE;
when BLUE => next_color <= TURQOISE;
when TURQOISE => next_color <= GREEN;
when GREEN => next_color <= YELLOW;
when YELLOW => next_color <= RED;
when OTHERS => next_color <= RED;
end case;
else
case current_color is
when RED => next_color <= BLUE;
when BLUE => next_color <= GREEN;
when GREEN => next_color <= WHITE;
when WHITE => next_color <= RED;
when OTHERS => next_color <= RED;
end case;
end if;
end process;
transition: process(BaseBeat,qtemp)
begin
if (qtemp = "10111110101111000010000000") then
ONEsec_flag <= '1';
end if;
if (BaseBeat'event and BaseBeat = '1') and (ONEsec_flag='1') then
current_color <= next_color;
ONEsec_flag <= '0';
else
current_color <= current_color;
end if;
end process;
control: process(current_color)
begin
case current_color is
-- main colors
when RED => outputTEMP <= "110";
when GREEN => outputTEMP <= "101";
when BLUE => outputTEMP <= "011";
--extended colors
when YELLOW => outputTEMP <= "100";
when TURQOISE => outputTEMP <= "001";
when PINK => outputTEMP <= "010";
--all or nothing
when WHITE => outputTEMP <= "000";
when OTHERS => outputTEMP <= "111";
end case;
end process;
--components
--main outputs
output <= outputTEMP;
-- on board led outputs
ON_BOARD_LED_output <= outputTEMP;
ON_BOARD_LED_color_scheme <= color_scheme;
ON_BOARD_LED_BaseBeat <= BaseBeat;
ON_BOARD_LED_ONEsec_flag<=ONEsec_flag;
end controller_behavior;
y mi UCF:
# Clocks NET "clk" LOC = " B8 " ;#Bank = 0, Signal name = MCLK # Pin assignment for LEDs NET "ON_BOARD_LED_output" LOC = "G1" ; # Bank = 3, Signal name = LD7 NET "ON_BOARD_LED_output" LOC = "P4" ; # Bank = 2, Signal name = LD6 NET "ON_BOARD_LED_output" LOC = "N4" ; # Bank = 2, Signal name = LD5 NET "ON_BOARD_LED_BaseBeat" LOC = "P6" ; # Bank = 2, Signal name = LD3 NET "ON_BOARD_LED_color_scheme" LOC = "M11" ; # Bank = 2, Signal name = LD1 NET "ON_BOARD_LED_color_scheme" LOC = "M5" ; # Bank = 2, Signal name = LD0 NET "ON_BOARD_LED_ONEsec_flag" LOC = "P7" ; # Bank = 2, Signal name = LD5 NET "color_scheme" LOC = "L3"; # Bank = 3, Signal name = SW1 NET "color_scheme" LOC = "P11"; # Bank = 2, Signal name = SW0 NET "BaseBeat" LOC = "A7"; # Bank = 1, Signal name = BTN3 # Loop Back only tested signals #NET "BaseBeat" LOC = "C6" | DRIVE = 2 | PULLUP ; # Bank = 1, Signal name = JA1 NET "output" LOC = "B6" | DRIVE = 2 | PULLUP ; # Bank = 1, Signal name = JA2 NET "output" LOC = "C5" | DRIVE = 2 | PULLUP ; # Bank = 1, Signal name = JA3 NET "output" LOC = "B7" | DRIVE = 2 | PULLUP ; # Bank = 1, Signal name = JA4 #NET "BaseBeat" CLOCK_DEDICATED_ROUTE = FALSE;
Lamento que esto sea largo, por favor, ayúdame. Si puedes, me he dado varios dolores de cabeza al leer mi libro y buscar en los foros sin éxito.
Gracias por adelantado,
Scott
EDITAR:
en respuesta a mi propio comentario sobre las sugerencias de @Paebbels
@Paebbels I do have a new issue now, even after a second has passed the transition does not always occur when BaseBeat is pressed. When I hold BaseBeat down for a long time, the lights start transiting every second, but when I quickly press them even after a second it does not always transition, only some times. Oddly enough, if I press the BaseBeat for say 1/2 a second it doesn't always transition either? (I thought it may have something to do with rising_edg(clk) and BaseBeat not occurring at the same time, but rising_edg(clk) occurs 25M times in half a second..) Thanks again
He alterado la declaración sugerida:
ONEsec_flag <= '1' when (qtemp = 49999999) else '0';
ser:
process(clk)
begin
if rising_edge(clk) then
if (qtemp = 49999999) then ONEsec_flag <= '1';
elsif (BaseBeat='1') then ONEsec_flag <= '0';
else ONEsec_flag <= ONEsec_flag;
end if;
end if;
end process;
¿Es esta una buena práctica de diseño? Parece que está funcionando ahora (cambia después de un segundo, independientemente de la duración o la velocidad con la que presione la BaseBeat) y creo que lo hice sincrónico, al menos en mi comprensión de síncrono.
Gracias por toda la ayuda, especialmente ustedes @Paebbels! ¡Ten un feliz año nuevo!