M
Mark Andrew
Guest
Hi,
just making my first tottering steps in synthesis and have come across
some (for a software person new to hardware) completely unexplainable
behaviour. I have a Spartan 2 based board with some buttons and lights
and am using the free 6.2 version of the Xilinx toolchain. The entity
listed below does exactly what I want when the code tests pbs(0)
against '0': i.e. it changes
the value of the counter (which goes to 4 seven segment displays)
according to whether I have pushed the button or not, and also
illuminates various leds depending on the value of a couple of
switches. But now for the puzzling part. If I test against '1'
instead, I have two effects. Firstly the display starts as "FFFF" and
does not change when I press the button, and secondly, the other bits
of logic after the if statement, going from the switches to the leds,
do not work either, no led is lit at any time.
What on earth can be going on?
Sorry if this is non-vhdl/too vendor-specific/a FAQ - I have been
looking everywhere and found nothing, but possibly do not know where I
should be looking. Would appreciate any hints you guys can throw my
way.
Thanks in advance
--
Mark
-----------------------------------------------------------------------
entity minialu is
Port ( switches : in std_logic_vector(7 downto 0);
leds : out std_logic_vector(7 downto 0);
clk : in std_logic;
pbs : in std_logic_vector(7 downto 0);
counter : out std_logic_vector(15 downto 0));
end minialu;
architecture Behavioral of minialu is
begin
xxx : process (pbs,switches)
begin
if pbs(0) = '0' then -- test for '0' works /test for '1'
fails
counter <= x"1234";
else
counter <= x"FFFF";
end if;
leds(0) <= pbs(0);
leds(7) <= switches(0) or switches(1);
leds(6) <= switches(0) and switches(1);
end process ;
end Behavioral;
just making my first tottering steps in synthesis and have come across
some (for a software person new to hardware) completely unexplainable
behaviour. I have a Spartan 2 based board with some buttons and lights
and am using the free 6.2 version of the Xilinx toolchain. The entity
listed below does exactly what I want when the code tests pbs(0)
against '0': i.e. it changes
the value of the counter (which goes to 4 seven segment displays)
according to whether I have pushed the button or not, and also
illuminates various leds depending on the value of a couple of
switches. But now for the puzzling part. If I test against '1'
instead, I have two effects. Firstly the display starts as "FFFF" and
does not change when I press the button, and secondly, the other bits
of logic after the if statement, going from the switches to the leds,
do not work either, no led is lit at any time.
What on earth can be going on?
Sorry if this is non-vhdl/too vendor-specific/a FAQ - I have been
looking everywhere and found nothing, but possibly do not know where I
should be looking. Would appreciate any hints you guys can throw my
way.
Thanks in advance
--
Mark
-----------------------------------------------------------------------
entity minialu is
Port ( switches : in std_logic_vector(7 downto 0);
leds : out std_logic_vector(7 downto 0);
clk : in std_logic;
pbs : in std_logic_vector(7 downto 0);
counter : out std_logic_vector(15 downto 0));
end minialu;
architecture Behavioral of minialu is
begin
xxx : process (pbs,switches)
begin
if pbs(0) = '0' then -- test for '0' works /test for '1'
fails
counter <= x"1234";
else
counter <= x"FFFF";
end if;
leds(0) <= pbs(0);
leds(7) <= switches(0) or switches(1);
leds(6) <= switches(0) and switches(1);
end process ;
end Behavioral;