F
Francesco Da Riva
Guest
Hi ALL,
my name is Francesco Da Riva and I have recentely bought a Spartan
3A starter kit board.
I have find a strange issue that i not be abble to solve. I
created a very simple greater 2 bit than comparator and connect it
with the switch and the led on the board.
All work perfectelly a part of for the input 1001, the led should
be turn on but it is not.
I try to simulate it on iSim and in simulation all work ok.
Could you help me?
Regards
Francesco Da Riva
VHDL CODE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity gt2 is
Port ( a : in STD_LOGIC_VECTOR (1 downto 0);
b : in STD_LOGIC_VECTOR (1 downto 0);
al : out STD_LOGIC_VECTOR (1 downto 0);
bl : out STD_LOGIC_VECTOR (1 downto 0);
agtb : out STD_LOGIC);
end gt2;
architecture sop_arch of gt2 is
signal p0, p1, p2, p3, p4, p5 : std_logic;
begin
agtb <= p0 or p1 or p2 or p3 or p4 or p5;
al <= a;
bl <= b;
p0 <= (not a(1)) and a(0) and (not b(1)) and (not b(0));
p1 <= a(1) and (not a(0)) and (not b(1)) and (not b(0));
p2 <= a(1) and (not a(0)) and (not b(1)) and b(0);
p3 <= a(1) and a(0) and (not b(1)) and (not b(0));
p4 <= a(1) and a(0) and (not b(1)) and b(0);
p5 <= a(1) and a(0) and b(1) and (not b(0));
end sop_arch;
CONSTRAINTS FILE
#========================================================
# buttons & switches
#========================================================
# 8 slide switches
NET "a<0>" LOC = "T9" | IOSTANDARD = LVCMOS33;
NET "a<1>" LOC = "U8" | IOSTANDARD = LVCMOS33;
NET "b<0>" LOC = "U10" | IOSTANDARD = LVCMOS33;
NET "b<1>" LOC = "V8" | IOSTANDARD = LVCMOS33;
#========================================================
# 8 discrete led
#========================================================
NET "agtb" LOC = "R20" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE
= 8;
NET "al<0>" LOC = "W21" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE
= 8;
NET "al<1>" LOC = "Y22" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE
= 8;
NET "bl<0>" LOC = "V20" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE
= 8;
NET "bl<1>" LOC = "V19" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE
= 8;
my name is Francesco Da Riva and I have recentely bought a Spartan
3A starter kit board.
I have find a strange issue that i not be abble to solve. I
created a very simple greater 2 bit than comparator and connect it
with the switch and the led on the board.
All work perfectelly a part of for the input 1001, the led should
be turn on but it is not.
I try to simulate it on iSim and in simulation all work ok.
Could you help me?
Regards
Francesco Da Riva
VHDL CODE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity gt2 is
Port ( a : in STD_LOGIC_VECTOR (1 downto 0);
b : in STD_LOGIC_VECTOR (1 downto 0);
al : out STD_LOGIC_VECTOR (1 downto 0);
bl : out STD_LOGIC_VECTOR (1 downto 0);
agtb : out STD_LOGIC);
end gt2;
architecture sop_arch of gt2 is
signal p0, p1, p2, p3, p4, p5 : std_logic;
begin
agtb <= p0 or p1 or p2 or p3 or p4 or p5;
al <= a;
bl <= b;
p0 <= (not a(1)) and a(0) and (not b(1)) and (not b(0));
p1 <= a(1) and (not a(0)) and (not b(1)) and (not b(0));
p2 <= a(1) and (not a(0)) and (not b(1)) and b(0);
p3 <= a(1) and a(0) and (not b(1)) and (not b(0));
p4 <= a(1) and a(0) and (not b(1)) and b(0);
p5 <= a(1) and a(0) and b(1) and (not b(0));
end sop_arch;
CONSTRAINTS FILE
#========================================================
# buttons & switches
#========================================================
# 8 slide switches
NET "a<0>" LOC = "T9" | IOSTANDARD = LVCMOS33;
NET "a<1>" LOC = "U8" | IOSTANDARD = LVCMOS33;
NET "b<0>" LOC = "U10" | IOSTANDARD = LVCMOS33;
NET "b<1>" LOC = "V8" | IOSTANDARD = LVCMOS33;
#========================================================
# 8 discrete led
#========================================================
NET "agtb" LOC = "R20" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE
= 8;
NET "al<0>" LOC = "W21" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE
= 8;
NET "al<1>" LOC = "Y22" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE
= 8;
NET "bl<0>" LOC = "V20" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE
= 8;
NET "bl<1>" LOC = "V19" | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE
= 8;