Some generic bug fixes
This commit is contained in:
@@ -19,23 +19,23 @@ begin
|
||||
process(hex)
|
||||
begin
|
||||
case hex is
|
||||
when "10000" => cathodes <= "10000001"; -- "0"
|
||||
when "10001" => cathodes <= "11110011"; -- "1"
|
||||
when "10010" => cathodes <= "01001001"; -- "2"
|
||||
when "10011" => cathodes <= "01100001"; -- "3"
|
||||
when "10100" => cathodes <= "00110011"; -- "4"
|
||||
when "10101" => cathodes <= "00100101"; -- "5"
|
||||
when "10110" => cathodes <= "00000101"; -- "6"
|
||||
when "10111" => cathodes <= "11110001"; -- "7"
|
||||
when "11000" => cathodes <= "00000001"; -- "8"
|
||||
when "11001" => cathodes <= "00100001"; -- "9"
|
||||
when "11010" => cathodes <= "00010001"; -- "A"
|
||||
when "11011" => cathodes <= "00000111"; -- "B"
|
||||
when "11100" => cathodes <= "10001101"; -- "C"
|
||||
when "11101" => cathodes <= "01000011"; -- "D"
|
||||
when "11110" => cathodes <= "00001101"; -- "E"
|
||||
when "11111" => cathodes <= "00011101"; -- "F"
|
||||
when others => cathodes <= "11111111"; -- "Off"
|
||||
when "10000" => cathodes <= not "11111100"; -- "0"
|
||||
when "10001" => cathodes <= not "01100000"; -- "1"
|
||||
when "10010" => cathodes <= not "11011010"; -- "2"
|
||||
when "10011" => cathodes <= not "11110010"; -- "3"
|
||||
when "10100" => cathodes <= not "01100110"; -- "4"
|
||||
when "10101" => cathodes <= not "10110110"; -- "5"
|
||||
when "10110" => cathodes <= not "10111110"; -- "6"
|
||||
when "10111" => cathodes <= not "11100000"; -- "7"
|
||||
when "11000" => cathodes <= not "11111110"; -- "8"
|
||||
when "11001" => cathodes <= not "11110110"; -- "9"
|
||||
when "11010" => cathodes <= not "11101110"; -- "A"
|
||||
when "11011" => cathodes <= not "00111110"; -- "B"
|
||||
when "11100" => cathodes <= not "10011100"; -- "C"
|
||||
when "11101" => cathodes <= not "01111010"; -- "D"
|
||||
when "11110" => cathodes <= not "10011110"; -- "E"
|
||||
when "11111" => cathodes <= not "10001110"; -- "F"
|
||||
when others => cathodes <= not "00000000"; -- "Off"
|
||||
end case;
|
||||
end process;
|
||||
|
||||
|
||||
@@ -62,7 +62,8 @@ begin
|
||||
);
|
||||
|
||||
timer: simple_timer
|
||||
generic map (timer_start => x"00000008")
|
||||
generic map (timer_start => x"00000008") -- for simulation
|
||||
-- generic map (timer_start => x"00000F00") -- for board
|
||||
port map(
|
||||
clk => clk,
|
||||
rst => rst,
|
||||
@@ -108,7 +109,7 @@ begin
|
||||
if clk'event and clk='1' then
|
||||
if rst = '1' then
|
||||
hex <= hex_register(4 downto 0);
|
||||
anodes <= (others => '0');
|
||||
anodes <= (others => not '0');
|
||||
overflow_counter <= 0;
|
||||
else
|
||||
if timer_overflow = '1' then
|
||||
@@ -118,8 +119,8 @@ begin
|
||||
overflow_counter <= overflow_counter + 1;
|
||||
end if;
|
||||
|
||||
anodes <= (others => '0');
|
||||
anodes(overflow_counter) <= '1';
|
||||
anodes <= (others => not '0');
|
||||
anodes(overflow_counter) <= not '1';
|
||||
|
||||
hex <= hex_register(overflow_counter * 8 + 4 downto overflow_counter * 8);
|
||||
end if;
|
||||
|
||||
@@ -64,7 +64,8 @@ begin
|
||||
);
|
||||
|
||||
timer: simple_timer
|
||||
generic map (timer_start => x"00000008")
|
||||
-- generic map (timer_start => x"00000008") -- for simulation
|
||||
generic map (timer_start => x"00000F00") -- for board
|
||||
port map(
|
||||
clk => clk,
|
||||
rst => rst,
|
||||
@@ -149,7 +150,7 @@ begin
|
||||
if clk'event and clk='1' then
|
||||
if rst = '1' then
|
||||
hex <= hex_register(4 downto 0);
|
||||
anodes <= (others => '0');
|
||||
anodes <= (others => not '0');
|
||||
overflow_counter <= 0;
|
||||
else
|
||||
if timer_overflow = '1' then
|
||||
@@ -159,8 +160,8 @@ begin
|
||||
overflow_counter <= overflow_counter + 1;
|
||||
end if;
|
||||
|
||||
anodes <= (others => '0');
|
||||
anodes(overflow_counter) <= '1';
|
||||
anodes <= (others => not '0');
|
||||
anodes(overflow_counter) <= not '1';
|
||||
|
||||
hex <= hex_register(overflow_counter * 8 + 4 downto overflow_counter * 8);
|
||||
end if;
|
||||
|
||||
@@ -53,14 +53,14 @@ set_property -dict { PACKAGE_PIN U16 IOSTANDARD LVCMOS33 } [get_ports { led[7]
|
||||
#set_property -dict { PACKAGE_PIN N16 IOSTANDARD LVCMOS33 } [get_ports { LED17_R }]; #IO_L11N_T1_SRCC_14 Sch=led17_r
|
||||
|
||||
##7 segment display
|
||||
set_property -dict { PACKAGE_PIN T10 IOSTANDARD LVCMOS33 } [get_ports { cathodes[0] }]; #IO_L24N_T3_A00_D16_14 Sch=ca
|
||||
set_property -dict { PACKAGE_PIN R10 IOSTANDARD LVCMOS33 } [get_ports { cathodes[1] }]; #IO_25_14 Sch=cb
|
||||
set_property -dict { PACKAGE_PIN K16 IOSTANDARD LVCMOS33 } [get_ports { cathodes[2] }]; #IO_25_15 Sch=cc
|
||||
set_property -dict { PACKAGE_PIN K13 IOSTANDARD LVCMOS33 } [get_ports { cathodes[3] }]; #IO_L17P_T2_A26_15 Sch=cd
|
||||
set_property -dict { PACKAGE_PIN P15 IOSTANDARD LVCMOS33 } [get_ports { cathodes[4] }]; #IO_L13P_T2_MRCC_14 Sch=ce
|
||||
set_property -dict { PACKAGE_PIN T11 IOSTANDARD LVCMOS33 } [get_ports { cathodes[5] }]; #IO_L19P_T3_A10_D26_14 Sch=cf
|
||||
set_property -dict { PACKAGE_PIN L18 IOSTANDARD LVCMOS33 } [get_ports { cathodes[6] }]; #IO_L4P_T0_D04_14 Sch=cg
|
||||
set_property -dict { PACKAGE_PIN H15 IOSTANDARD LVCMOS33 } [get_ports { cathodes[7] }]; #IO_L19N_T3_A21_VREF_15 Sch=dp
|
||||
set_property -dict { PACKAGE_PIN T10 IOSTANDARD LVCMOS33 } [get_ports { cathodes[7] }]; #IO_L24N_T3_A00_D16_14 Sch=ca
|
||||
set_property -dict { PACKAGE_PIN R10 IOSTANDARD LVCMOS33 } [get_ports { cathodes[6] }]; #IO_25_14 Sch=cb
|
||||
set_property -dict { PACKAGE_PIN K16 IOSTANDARD LVCMOS33 } [get_ports { cathodes[5] }]; #IO_25_15 Sch=cc
|
||||
set_property -dict { PACKAGE_PIN K13 IOSTANDARD LVCMOS33 } [get_ports { cathodes[4] }]; #IO_L17P_T2_A26_15 Sch=cd
|
||||
set_property -dict { PACKAGE_PIN P15 IOSTANDARD LVCMOS33 } [get_ports { cathodes[3] }]; #IO_L13P_T2_MRCC_14 Sch=ce
|
||||
set_property -dict { PACKAGE_PIN T11 IOSTANDARD LVCMOS33 } [get_ports { cathodes[2] }]; #IO_L19P_T3_A10_D26_14 Sch=cf
|
||||
set_property -dict { PACKAGE_PIN L18 IOSTANDARD LVCMOS33 } [get_ports { cathodes[1] }]; #IO_L4P_T0_D04_14 Sch=cg
|
||||
set_property -dict { PACKAGE_PIN H15 IOSTANDARD LVCMOS33 } [get_ports { cathodes[0] }]; #IO_L19N_T3_A21_VREF_15 Sch=dp
|
||||
set_property -dict { PACKAGE_PIN J17 IOSTANDARD LVCMOS33 } [get_ports { anodes[0] }]; #IO_L23P_T3_FOE_B_15 Sch=an[0]
|
||||
set_property -dict { PACKAGE_PIN J18 IOSTANDARD LVCMOS33 } [get_ports { anodes[1] }]; #IO_L23N_T3_FWE_B_15 Sch=an[1]
|
||||
set_property -dict { PACKAGE_PIN T9 IOSTANDARD LVCMOS33 } [get_ports { anodes[2] }]; #IO_L24P_T3_A01_D17_14 Sch=an[2]
|
||||
|
||||
Reference in New Issue
Block a user