vertigo_vhdl 0.8.9 → 0.8.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/lib/vertigo/parser.rb +28 -5
  3. data/lib/vertigo/tb_generator.rb +1 -1
  4. data/lib/vertigo/version.rb +1 -1
  5. data/tests/parser_tests/test_adder_rca_vhdl93.vhd +37 -0
  6. metadata +4 -85
  7. data/tests/ghdl_tests/test_fsm.vhd +0 -162
  8. data/tests/parser_tests/else.vhd +0 -64
  9. data/tests/parser_tests/pingpong.vhd +0 -34
  10. data/tests/parser_tests/test_accelerator_pp.vhd +0 -144
  11. data/tests/parser_tests/test_aggregate_pp.vhd +0 -15
  12. data/tests/parser_tests/test_archi_1_pp.vhd +0 -41
  13. data/tests/parser_tests/test_array_array_00_pp.vhd +0 -25
  14. data/tests/parser_tests/test_array_urange_pp.vhd +0 -25
  15. data/tests/parser_tests/test_chu-1_pp.vhd +0 -104
  16. data/tests/parser_tests/test_concat_pp.vhd +0 -14
  17. data/tests/parser_tests/test_counter_pp.vhd +0 -35
  18. data/tests/parser_tests/test_de2_pp.vhd +0 -274
  19. data/tests/parser_tests/test_encode_pp.vhd +0 -2549
  20. data/tests/parser_tests/test_fsm_pp.vhd +0 -125
  21. data/tests/parser_tests/test_fsm_synth_pp.vhd +0 -197
  22. data/tests/parser_tests/test_function-01_pp.vhd +0 -18
  23. data/tests/parser_tests/test_lfsr_pp.vhd +0 -44
  24. data/tests/parser_tests/test_microwatt_cache_ram_pp.vhd +0 -68
  25. data/tests/parser_tests/test_microwatt_common_pp.vhd +0 -336
  26. data/tests/parser_tests/test_microwatt_control_pp.vhd +0 -187
  27. data/tests/parser_tests/test_microwatt_core_debug_pp.vhd +0 -104
  28. data/tests/parser_tests/test_microwatt_core_pp.vhd +0 -231
  29. data/tests/parser_tests/test_microwatt_core_tb_pp.vhd +0 -43
  30. data/tests/parser_tests/test_microwatt_countzero_pp.vhd +0 -120
  31. data/tests/parser_tests/test_microwatt_countzero_tb_pp.vhd +0 -70
  32. data/tests/parser_tests/test_microwatt_cr_file_pp.vhd +0 -74
  33. data/tests/parser_tests/test_microwatt_cr_hazard_pp.vhd +0 -51
  34. data/tests/parser_tests/test_microwatt_crhelpers_pp.vhd +0 -48
  35. data/tests/parser_tests/test_microwatt_dcache_pp.vhd +0 -481
  36. data/tests/parser_tests/test_microwatt_dcache_tb_pp.vhd +0 -98
  37. data/tests/parser_tests/test_microwatt_decode1_pp.vhd +0 -138
  38. data/tests/parser_tests/test_microwatt_decode2_pp.vhd +0 -300
  39. data/tests/parser_tests/test_microwatt_decode_types_pp.vhd +0 -67
  40. data/tests/parser_tests/test_microwatt_divider_pp.vhd +0 -132
  41. data/tests/parser_tests/test_microwatt_divider_tb_pp.vhd +0 -95
  42. data/tests/parser_tests/test_microwatt_dmi_dtm_dummy_pp.vhd +0 -29
  43. data/tests/parser_tests/test_microwatt_dmi_dtm_tb_pp.vhd +0 -197
  44. data/tests/parser_tests/test_microwatt_dmi_dtm_xilinx_pp.vhd +0 -139
  45. data/tests/parser_tests/test_microwatt_execute1_pp.vhd +0 -689
  46. data/tests/parser_tests/test_microwatt_fetch1_pp.vhd +0 -88
  47. data/tests/parser_tests/test_microwatt_fetch2_pp.vhd +0 -79
  48. data/tests/parser_tests/test_microwatt_glibc_random_helpers_pp.vhd +0 -25
  49. data/tests/parser_tests/test_microwatt_glibc_random_pp.vhd +0 -41
  50. data/tests/parser_tests/test_microwatt_gpr_hazard_pp.vhd +0 -68
  51. data/tests/parser_tests/test_microwatt_helpers_pp.vhd +0 -153
  52. data/tests/parser_tests/test_microwatt_icache_pp.vhd +0 -337
  53. data/tests/parser_tests/test_microwatt_icache_tb_pp.vhd +0 -104
  54. data/tests/parser_tests/test_microwatt_insn_helpers_pp.vhd +0 -208
  55. data/tests/parser_tests/test_microwatt_loadstore1_pp.vhd +0 -222
  56. data/tests/parser_tests/test_microwatt_logical_pp.vhd +0 -87
  57. data/tests/parser_tests/test_microwatt_multiply_pp.vhd +0 -84
  58. data/tests/parser_tests/test_microwatt_multiply_tb_pp.vhd +0 -75
  59. data/tests/parser_tests/test_microwatt_plru_pp.vhd +0 -46
  60. data/tests/parser_tests/test_microwatt_plru_tb_pp.vhd +0 -93
  61. data/tests/parser_tests/test_microwatt_ppc_fx_insns_pp.vhd +0 -665
  62. data/tests/parser_tests/test_microwatt_register_file_pp.vhd +0 -86
  63. data/tests/parser_tests/test_microwatt_rotator_pp.vhd +0 -149
  64. data/tests/parser_tests/test_microwatt_rotator_tb_pp.vhd +0 -134
  65. data/tests/parser_tests/test_microwatt_sim_bram_helpers_pp.vhd +0 -52
  66. data/tests/parser_tests/test_microwatt_sim_bram_pp.vhd +0 -53
  67. data/tests/parser_tests/test_microwatt_sim_console_pp.vhd +0 -43
  68. data/tests/parser_tests/test_microwatt_sim_jtag_pp.vhd +0 -64
  69. data/tests/parser_tests/test_microwatt_sim_jtag_socket_pp.vhd +0 -36
  70. data/tests/parser_tests/test_microwatt_sim_uart_pp.vhd +0 -90
  71. data/tests/parser_tests/test_microwatt_soc_pp.vhd +0 -195
  72. data/tests/parser_tests/test_microwatt_utils_pp.vhd +0 -39
  73. data/tests/parser_tests/test_microwatt_wishbone_arbiter_pp.vhd +0 -54
  74. data/tests/parser_tests/test_microwatt_wishbone_bram_tb_pp.vhd +0 -157
  75. data/tests/parser_tests/test_microwatt_wishbone_bram_wrapper_pp.vhd +0 -62
  76. data/tests/parser_tests/test_microwatt_wishbone_debug_master_pp.vhd +0 -124
  77. data/tests/parser_tests/test_microwatt_wishbone_types_pp.vhd +0 -38
  78. data/tests/parser_tests/test_microwatt_writeback_pp.vhd +0 -87
  79. data/tests/parser_tests/test_package-1_pp.vhd +0 -53
  80. data/tests/parser_tests/test_precedence_pp.vhd +0 -16
  81. data/tests/parser_tests/test_selected_sig_pp.vhd +0 -10
  82. data/tests/parser_tests/test_slice_pp.vhd +0 -16
  83. data/tests/parser_tests/test_tb-00_pp.vhd +0 -71
  84. data/tests/parser_tests/test_type_decl_02_pp.vhd +0 -11
  85. data/tests/parser_tests/test_use_pp.vhd +0 -10
  86. data/tests/parser_tests/test_while_1_pp.vhd +0 -26
  87. data/tests/parser_tests/test_with-00_pp.vhd +0 -12
  88. data/tests/tb_gen_tests/test_accelerator.vhd +0 -160
@@ -1,54 +0,0 @@
1
- -- generated by Vertigo VHDL tool
2
- library ieee;
3
- use ieee.std_logic_1164.all;
4
- library work;
5
- use work.wishbone_types.all;
6
-
7
- entity wishbone_arbiter is
8
- generic(
9
- num_masters : positive3 := 3);
10
- port(
11
- clk : in std_ulogic;
12
- rst : in std_ulogic;
13
- wb_masters_in : in wishbone_master_out_vector(0 to num_masters - 1);
14
- wb_masters_out : out wishbone_slave_out_vector(0 to num_masters - 1);
15
- wb_slave_out : out wishbone_master_out;
16
- wb_slave_in : in wishbone_slave_out);
17
- end entity wishbone_arbiter;
18
-
19
- architecture behave of wishbone_arbiter is
20
-
21
- subtype wb_arb_master_t is integer range 0 to num_masters - 1;
22
- signal candidate : wb_arb_master_t;
23
- signal selected : wb_arb_master_t;
24
- signal busy : std_ulogic;
25
- begin
26
-
27
- busy <= wb_masters_in(selected).cyc;
28
-
29
- wishbone_muxes : process(selected,candidate,busy,wb_slave_in,wb_masters_in)
30
- variable early_sel : wb_arb_master_t;
31
- begin
32
- early_sel := selected;
33
- if busy = '0' then
34
- early_sel := candidate;
35
- end if;
36
- wb_slave_out <= wb_masters_in(early_sel);
37
- end process;
38
-
39
- wishbone_candidate : process(all)
40
- begin
41
- candidate <= selected;
42
- end process;
43
-
44
- wishbone_arbiter_process : process(clk)
45
- begin
46
- if rising_edge(clk) then
47
- if rst = '1' then
48
- selected <= 0;
49
- elsif busy = '0' then
50
- selected <= candidate;
51
- end if;
52
- end if;
53
- end process;
54
- end behave;
@@ -1,157 +0,0 @@
1
- -- generated by Vertigo VHDL tool
2
- library ieee;
3
- use ieee.std_logic_1164.all;
4
- use ieee.numeric_std.all;
5
- library work;
6
- use work.wishbone_types.all;
7
-
8
- entity wishbone_bram_tb is
9
- end entity wishbone_bram_tb;
10
-
11
- architecture behave of wishbone_bram_tb is
12
- signal clk : std_ulogic;
13
- signal rst : std_ulogic := '1';
14
- constant clk_period : time := 10 ns;
15
- signal w_in : wishbone_slave_out;
16
- signal w_out : wishbone_master_out;
17
-
18
- function to_adr(a : integer) return std_ulogic_vector is
19
- begin
20
- return std_ulogic_vector(to_unsigned(a,w_out.adr'length));
21
- end function to_adr;
22
- begin
23
-
24
- simple_ram_0 : entity work.wishbone_bram_wrapper
25
- port map(
26
- clk => clk,
27
- rst => rst,
28
- wishbone_out => w_in,
29
- wishbone_in => w_out);
30
-
31
-
32
- clock : process
33
- begin
34
- clk <= '1';
35
- wait clk_period / 2;
36
- clk <= '0';
37
- wait clk_period / 2;
38
- end process;
39
-
40
- stim : process
41
- begin
42
- w_out.adr <= (others => '0');
43
- w_out.dat <= (others => '0');
44
- w_out.cyc <= '0';
45
- w_out.stb <= '0';
46
- w_out.sel <= (others => '0');
47
- w_out.we <= '0';
48
- wait rising_edge(clk);
49
- rst <= '0';
50
- wait rising_edge(clk);
51
- w_out.cyc <= '1';
52
- w_out.stb <= '1';
53
- w_out.sel <= "11111111";
54
- w_out.adr <= to_adr(0);
55
- assert w_in.ack = '0';
56
- wait rising_edge(clk);
57
- w_out.stb <= '0';
58
- wait rising_edge(clk);
59
- wait rising_edge(clk);
60
- assert w_in.ack = '1';
61
- assert w_in.dat(63 downto 0) = x"0706050403020100"
62
- report to_hstring(w_in.dat);
63
- wait rising_edge(clk);
64
- assert w_in.ack = '0';
65
- w_out.stb <= '1';
66
- w_out.sel <= "11111111";
67
- w_out.adr <= to_adr(8);
68
- assert w_in.ack = '0';
69
- wait rising_edge(clk);
70
- w_out.stb <= '0';
71
- wait rising_edge(clk);
72
- wait rising_edge(clk);
73
- assert w_in.ack = '1';
74
- assert w_in.dat(63 downto 0) = x"0f0e0d0c0b0a0908"
75
- report to_hstring(w_in.dat);
76
- wait rising_edge(clk);
77
- assert w_in.ack = '0';
78
- w_out.stb <= '1';
79
- w_out.sel <= "00000001";
80
- w_out.adr <= to_adr(0);
81
- w_out.we <= '1';
82
- w_out.dat(7 downto 0) <= x"0f";
83
- assert w_in.ack = '0';
84
- wait rising_edge(clk);
85
- w_out.stb <= '0';
86
- wait rising_edge(clk) and w_in.ack = '1';
87
- wait rising_edge(clk);
88
- assert w_in.ack = '0';
89
- w_out.stb <= '1';
90
- w_out.sel <= "11111111";
91
- w_out.adr <= to_adr(0);
92
- w_out.we <= '0';
93
- assert w_in.ack = '0';
94
- wait rising_edge(clk);
95
- w_out.stb <= '0';
96
- wait rising_edge(clk);
97
- wait rising_edge(clk);
98
- assert w_in.ack = '1';
99
- assert w_in.dat(63 downto 0) = x"070605040302010f"
100
- report to_hstring(w_in.dat);
101
- wait rising_edge(clk);
102
- assert w_in.ack = '0';
103
- w_out.stb <= '1';
104
- w_out.sel <= "11110000";
105
- w_out.adr <= to_adr(0);
106
- w_out.we <= '1';
107
- w_out.dat(63 downto 32) <= x"baadfeed";
108
- assert w_in.ack = '0';
109
- wait rising_edge(clk);
110
- w_out.stb <= '0';
111
- wait rising_edge(clk) and w_in.ack = '1';
112
- wait rising_edge(clk);
113
- assert w_in.ack = '0';
114
- w_out.stb <= '1';
115
- w_out.sel <= "11111111";
116
- w_out.adr <= to_adr(0);
117
- w_out.we <= '0';
118
- assert w_in.ack = '0';
119
- wait rising_edge(clk);
120
- w_out.stb <= '0';
121
- wait rising_edge(clk);
122
- wait rising_edge(clk);
123
- assert w_in.ack = '1';
124
- assert w_in.dat(63 downto 0) = x"baadfeed0302010f"
125
- report to_hstring(w_in.dat);
126
- wait rising_edge(clk);
127
- assert w_in.ack = '0';
128
- w_out.stb <= '1';
129
- w_out.sel <= "11111111";
130
- w_out.adr <= to_adr(8);
131
- w_out.we <= '1';
132
- w_out.dat(63 downto 0) <= x"0001020304050607";
133
- assert w_in.ack = '0';
134
- wait rising_edge(clk);
135
- w_out.stb <= '0';
136
- wait rising_edge(clk) and w_in.ack = '1';
137
- wait rising_edge(clk);
138
- assert w_in.ack = '0';
139
- w_out.stb <= '1';
140
- w_out.sel <= "11111111";
141
- w_out.adr <= to_adr(8);
142
- w_out.we <= '0';
143
- assert w_in.ack = '0';
144
- wait rising_edge(clk);
145
- w_out.stb <= '0';
146
- wait rising_edge(clk);
147
- wait rising_edge(clk);
148
- assert w_in.ack = '1';
149
- assert w_in.dat(63 downto 0) = x"0001020304050607"
150
- report to_hstring(w_in.dat);
151
- wait rising_edge(clk);
152
- assert w_in.ack = '0';
153
- assert false
154
- report "end of test" severity failure;
155
- wait ;
156
- end process;
157
- end behave;
@@ -1,62 +0,0 @@
1
- -- generated by Vertigo VHDL tool
2
- library ieee;
3
- use ieee.std_logic_1164.all;
4
- use ieee.numeric_std.all;
5
- use std.textio.all;
6
- library work;
7
- use work.utils.all;
8
- use work.wishbone_types.all;
9
-
10
- entity wishbone_bram_wrapper is
11
- generic(
12
- memory_size : natural4096 := 4096;
13
- ram_init_file : string);
14
- port(
15
- clk : in std_logic;
16
- rst : in std_logic;
17
- wishbone_in : in wishbone_master_out;
18
- wishbone_out : out wishbone_slave_out);
19
- end entity wishbone_bram_wrapper;
20
-
21
- architecture behaviour of wishbone_bram_wrapper is
22
- constant ram_addr_bits : integer := log2ceil(memory_size) - 3;
23
- signal ram_addr : std_logic_vector(ram_addr_bits - 1 downto 0);
24
- signal ram_we : std_ulogic;
25
- signal ram_re : std_ulogic;
26
- signal ack : std_ulogic;
27
- signal ack_buf : std_ulogic;
28
- begin
29
-
30
- ram_0 : entity work.main_bram
31
- port map(
32
- clk => clk,
33
- addr => ram_addr,
34
- di => wishbone_in.dat,
35
- do => wishbone_out.dat,
36
- sel => wishbone_in.sel,
37
- re => ram_re,
38
- we => ram_we);
39
-
40
- ram_addr <= wishbone_in.adr(ram_addr_bits + 2 downto 3);
41
- ram_we <= wishbone_in.stb and wishbone_in.cyc and wishbone_in.we;
42
- ram_re <= wishbone_in.stb and wishbone_in.cyc and wishbone_in.we;
43
- wishbone_out.stall <= '0';
44
- wishbone_out.ack <= ack_buf;
45
-
46
- wb_0 : process(clk)
47
- begin
48
- if rising_edge(clk) then
49
- if rst = '1' or wishbone_in.cyc = '0' then
50
- ack_buf <= '0';
51
- ack <= '0';
52
- else
53
- if ram_we = '1' and ack = '0' then
54
- ack_buf <= '1';
55
- else
56
- ack <= wishbone_in.stb;
57
- ack_buf <= ack;
58
- end if;
59
- end if;
60
- end if;
61
- end process;
62
- end behaviour;
@@ -1,124 +0,0 @@
1
- -- generated by Vertigo VHDL tool
2
- library ieee;
3
- use ieee.std_logic_1164.all;
4
- use ieee.numeric_std.all;
5
- library work;
6
- use work.wishbone_types.all;
7
-
8
- entity wishbone_debug_master is
9
- port(
10
- clk : in std_ulogic;
11
- rst : in std_ulogic;
12
- dmi_addr : in std_ulogic_vector(1 downto 0);
13
- dmi_din : in std_ulogic_vector(63 downto 0);
14
- dmi_dout : out std_ulogic_vector(63 downto 0);
15
- dmi_req : in std_ulogic;
16
- dmi_wr : in std_ulogic;
17
- dmi_ack : out std_ulogic;
18
- wb_out : out wishbone_master_out;
19
- wb_in : in wishbone_slave_out);
20
- end entity wishbone_debug_master;
21
-
22
- architecture behaviour of wishbone_debug_master is
23
- constant dbg_wb_addr : std_ulogic_vector(1 downto 0) := "00";
24
- constant dbg_wb_data : std_ulogic_vector(1 downto 0) := "01";
25
- constant dbg_wb_ctrl : std_ulogic_vector(1 downto 0) := "10";
26
- constant dbg_wb_rsvd : std_ulogic_vector(1 downto 0) := "11";
27
- signal reg_addr : std_ulogic_vector(63 downto 0);
28
- signal reg_ctrl_out : std_ulogic_vector(63 downto 0);
29
- signal reg_ctrl : std_ulogic_vector(10 downto 0);
30
- signal data_latch : std_ulogic_vector(63 downto 0);
31
-
32
- type state_t is (idle,wb_cycle,dmi_wait);
33
- signal state : state_t;
34
- begin
35
-
36
- with dmi_addr select dmi_dout <=
37
- reg_addr when dbg_wb_addr,
38
- data_latch when dbg_wb_data,
39
- reg_ctrl_out when dbg_wb_ctrl,
40
- (others => '0') when others,;
41
-
42
- reg_write : process(clk)
43
-
44
- subtype autoinc_inc_t is integer range 1 to 8;
45
-
46
- function decode_autoinc(c : std_ulogic_vector(1 downto 0)) return autoinc_inc_t is
47
- begin
48
- case c is
49
- when "00" =>
50
- return 1;
51
- when "01" =>
52
- return 2;
53
- when "10" =>
54
- return 4;
55
- when "11" =>
56
- return 8;
57
- when others =>
58
- return 8;
59
- end case;
60
- end function decode_autoinc;
61
- begin
62
- if rising_edge(clk) then
63
- if (rst) then
64
- reg_addr <= (others => '0');
65
- reg_ctrl <= (others => '0');
66
- else
67
- if dmi_req and dmi_wr then
68
- if dmi_addr = dbg_wb_addr then
69
- reg_addr <= dmi_din;
70
- elsif dmi_addr = dbg_wb_ctrl then
71
- reg_ctrl <= dmi_din(10 downto 0);
72
- end if;
73
- elsif state = wb_cycle and (wb_in.ack and reg_ctrl(8)) = '1' then
74
- reg_addr <= std_ulogic_vector(unsigned(reg_addr) + decode_autoinc(reg_ctrl(10 downto 9)));
75
- end if;
76
- end if;
77
- end if;
78
- end process;
79
- dmi_ack <= dmi_req when (dmi_addr /= dbg_wb_data or state = dmi_wait) else '0';
80
- wb_out.adr <= reg_addr(wb_out.adr'left downto 0);
81
- wb_out.dat <= dmi_din;
82
- wb_out.sel <= reg_ctrl(7 downto 0);
83
- wb_out.we <= dmi_wr;
84
- wb_out.cyc <= '1' when state = wb_cycle else '0';
85
-
86
- latch_reads : process(clk)
87
- begin
88
- if rising_edge(clk) then
89
- if state = wb_cycle and wb_in.ack = '1' and dmi_wr = '0' then
90
- data_latch <= wb_in.dat;
91
- end if;
92
- end if;
93
- end process;
94
-
95
- wb_trigger : process(clk)
96
- begin
97
- if rising_edge(clk) then
98
- if (rst) then
99
- state <= idle;
100
- wb_out.stb <= '0';
101
- else
102
- case state is
103
- when idle =>
104
- if dmi_req = '1' and dmi_addr = dbg_wb_data then
105
- state <= wb_cycle;
106
- wb_out.stb <= '1';
107
- end if;
108
- when wb_cycle =>
109
- if wb_in.stall = '0' then
110
- wb_out.stb <= '0';
111
- end if;
112
- if wb_in.ack then
113
- wb_out.stb <= '0';
114
- state <= dmi_wait;
115
- end if;
116
- when dmi_wait =>
117
- if dmi_req = '0' then
118
- state <= idle;
119
- end if;
120
- end case;
121
- end if;
122
- end if;
123
- end process;
124
- end behaviour;
@@ -1,38 +0,0 @@
1
- -- generated by Vertigo VHDL tool
2
- library ieee;
3
- use ieee.std_logic_1164.all;
4
-
5
- package wishbone_types is
6
- constant wishbone_addr_bits : integer := 32;
7
- constant wishbone_data_bits : integer := 64;
8
- constant wishbone_sel_bits : integer := wishbone_data_bits / 8;
9
-
10
- subtype wishbone_addr_type is std_ulogic_vector(wishbone_addr_bits - 1 downto 0);
11
-
12
- subtype wishbone_data_type is std_ulogic_vector(wishbone_data_bits - 1 downto 0);
13
-
14
- subtype wishbone_sel_type is std_ulogic_vector(wishbone_sel_bits - 1 downto 0);
15
-
16
- type wishbone_master_out is record
17
- adr : wishbone_addr_type;
18
- dat : wishbone_data_type;
19
- cyc : std_ulogic;
20
- stb : std_ulogic;
21
- sel : wishbone_sel_type;
22
- we : std_ulogic;
23
- end record;
24
- constant wishbone_master_out_init : wishbone_master_out := (cyc => '0',stb => '0',we => '0',others => (others => '0'));
25
-
26
- type wishbone_slave_out is record
27
- dat : wishbone_data_type;
28
- ack : std_ulogic;
29
- stall : std_ulogic;
30
- end record;
31
- constant wishbone_slave_out_init : wishbone_slave_out := (ack => '0',stall => '0',others => (others => '0'));
32
-
33
- type wishbone_master_out_vector is array(natural range <>) of wishbone_master_out;
34
-
35
- type wishbone_slave_out_vector is array(natural range <>) of wishbone_slave_out;
36
-
37
- end wishbone_types;
38
-
@@ -1,87 +0,0 @@
1
- -- generated by Vertigo VHDL tool
2
- library ieee;
3
- use ieee.std_logic_1164.all;
4
- use ieee.numeric_std.all;
5
- library work;
6
- use work.common.all;
7
- use work.crhelpers.all;
8
-
9
- entity writeback is
10
- port(
11
- clk : in std_ulogic;
12
- e_in : in execute1towritebacktype;
13
- l_in : in loadstore1towritebacktype;
14
- w_out : out writebacktoregisterfiletype;
15
- c_out : out writebacktocrfiletype;
16
- complete_out : out std_ulogic);
17
- end entity writeback;
18
-
19
- architecture behaviour of writeback is
20
- begin
21
-
22
-
23
- writeback_1 : process(all)
24
- variable x : std_ulogic_vector(0 downto 0);
25
- variable y : std_ulogic_vector(0 downto 0);
26
- variable w : std_ulogic_vector(0 downto 0);
27
- variable cf : std_ulogic_vector(3 downto 0);
28
- variable zero : std_ulogic;
29
- variable sign : std_ulogic;
30
- variable scf : std_ulogic_vector(3 downto 0);
31
- begin
32
- x(0) := e_in.valid;
33
- y(0) := l_in.valid;
34
- assert (to_integer(unsigned(x)) + to_integer(unsigned(y))) <= 1;
35
- x(0) := e_in.write_enable;
36
- y(0) := l_in.write_enable;
37
- assert (to_integer(unsigned(x)) + to_integer(unsigned(y))) <= 1;
38
- w(0) := e_in.write_cr_enable;
39
- x(0) := (e_in.write_enable and e_in.rc);
40
- assert (to_integer(unsigned(w)) + to_integer(unsigned(x))) <= 1;
41
- w_out <= writebacktoregisterfileinit;
42
- c_out <= writebacktocrfileinit;
43
- complete_out <= '0';
44
- if e_in.valid = '1' or l_in.valid = '1' then
45
- complete_out <= '1';
46
- end if;
47
- if e_in.write_enable = '1' then
48
- w_out.write_reg <= e_in.write_reg;
49
- w_out.write_data <= e_in.write_data;
50
- w_out.write_enable <= '1';
51
- end if;
52
- if e_in.write_cr_enable = '1' then
53
- c_out.write_cr_enable <= '1';
54
- c_out.write_cr_mask <= e_in.write_cr_mask;
55
- c_out.write_cr_data <= e_in.write_cr_data;
56
- end if;
57
- if e_in.write_xerc_enable = '1' then
58
- c_out.write_xerc_enable <= '1';
59
- c_out.write_xerc_data <= e_in.xerc;
60
- end if;
61
- if l_in.write_enable = '1' then
62
- w_out.write_reg <= gpr_to_gspr(l_in.write_reg);
63
- w_out.write_data <= l_in.write_data;
64
- w_out.write_enable <= '1';
65
- end if;
66
- if l_in.rc = '1' then
67
- scf(3) := '0';
68
- scf(2) := '0';
69
- scf(1) := l_in.store_done;
70
- scf(0) := l_in.xerc.so;
71
- c_out.write_cr_enable <= '1';
72
- c_out.write_cr_mask <= num_to_fxm(0);
73
- c_out.write_cr_data(31 downto 28) <= scf;
74
- end if;
75
- if e_in.rc = '1' and e_in.write_enable = '1' then
76
- sign := e_in.write_data(63);
77
- zero := (or(e_in.write_data));
78
- c_out.write_cr_enable <= '1';
79
- c_out.write_cr_mask <= num_to_fxm(0);
80
- cf(3) := sign;
81
- cf(2) := sign and zero;
82
- cf(1) := zero;
83
- cf(0) := e_in.xerc.so;
84
- c_out.write_cr_data(31 downto 28) <= cf;
85
- end if;
86
- end process;
87
- end behaviour;