- Config File:
8default_shared_register_polarity = '0'
9default_signal_polarity = '0'
10default_voltage_standard = 3.
3V
11pinout_filename = PINOUT.xdc
14default_time_units = ms
15alias srr is state_reg_rec(0);
16alias state_reg : integer is state_reg_rec(0).state_reg;
19output anode(8) = N6, M6, M3, N5, N2, N4, L1, M1
20output sseg(7) = L3, N1, L5, L4, K3, M2, L6
21constant sseg_array : std_logic_vector_array := read_array_from_file("sseg_array.dat");
- VHDL Code:
2use ieee.std_logic_1164.
all;
3use ieee.numeric_std.
all;
4use ieee.std_logic_unsigned.
all;
5use work.user_defs_pkg.
all;
6use work.speakhdl_api_pkg.
all;
11 generic (this_sm : integer := -1);
15 sm_input : in std_logic_vector(-1 downto 0);
16 sm_output : out std_logic_vector(14 downto 0);
17 sm_io : inout std_logic_vector(-1 downto 0);
18 next_state_rec : out nsr_array(0 to 0);
19 state_reg_rec : in srr_array(0 to 0)
22end entity sseg_display;
25architecture arch
of sseg_display
is
27 alias anode : std_logic_vector(7 downto 0) is sm_output(7 downto 0);
28 alias sseg : std_logic_vector(6 downto 0) is sm_output(14 downto 8);
29 alias srr is state_reg_rec(0);
30 alias state_reg : integer is state_reg_rec(0).state_reg;
31 signal mux_counter_i : integer;
33 constant sseg_array : std_logic_vector_array :=
34 read_array_from_file("sseg_array.dat");
39 anode(0) <= '0' when (srr.delay.value = 0) else
41 anode(1) <= '0' when (srr.delay.value = 1) else
43 anode(2) <= '0' when (srr.delay.value = 2) else
45 anode(7 downto 3) <= (others => '1');
47 sseg(6 downto 0) <= sseg_array(mux_counter_i)(6 downto 0);
51 mux_counter_i <= srr.counter(srr.delay.value + 1).value;
62 RESOURCE_SELECT( sys_clk, next_state_rec, state_reg_rec );
64 TIME_COUNTER( 3, ms(1), next_state_rec, state_reg_rec );
65 CONFIGURE_COUNTER( 0, ms(100), -1, next_state_rec, state_reg_rec );
66 CONFIGURE_COUNTER( 1, 10, no_trans, next_state_rec, state_reg_rec, chain );
67 CONFIGURE_COUNTER( 2, 10, no_trans, next_state_rec, state_reg_rec, chain );
68 CONFIGURE_COUNTER( 3, 10, no_trans, next_state_rec, state_reg_rec, chain );
- Data File of Seven Segment Values:
- See also
- led_blink_example
-
uart_loopback_example
-
vga_controller_example