forked from openhwgroup/cva6
-
Notifications
You must be signed in to change notification settings - Fork 32
/
cva6.sv
1840 lines (1727 loc) · 71.3 KB
/
cva6.sv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2017-2019 ETH Zurich and University of Bologna.
// Copyright and related rights are licensed under the Solderpad Hardware
// License, Version 0.51 (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://solderpad.org/licenses/SHL-0.51. Unless required by applicable law
// or agreed to in writing, software, hardware and materials distributed under
// this License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
//
// Author: Florian Zaruba, ETH Zurich
// Date: 19.03.2017
// Description: CVA6 Top-level module
`include "rvfi_types.svh"
`include "cvxif_types.svh"
module cva6
import ariane_pkg::*;
#(
// CVA6 config
parameter config_pkg::cva6_cfg_t CVA6Cfg = build_config_pkg::build_config(
cva6_config_pkg::cva6_cfg
),
// RVFI PROBES
parameter type rvfi_probes_instr_t = `RVFI_PROBES_INSTR_T(CVA6Cfg),
parameter type rvfi_probes_csr_t = `RVFI_PROBES_CSR_T(CVA6Cfg),
parameter type rvfi_probes_t = struct packed {
logic csr;
rvfi_probes_instr_t instr;
},
// branchpredict scoreboard entry
// this is the struct which we will inject into the pipeline to guide the various
// units towards the correct branch decision and resolve
localparam type branchpredict_sbe_t = struct packed {
cf_t cf; // type of control flow prediction
logic [CVA6Cfg.VLEN-1:0] predict_address; // target address at which to jump, or not
},
localparam type exception_t = struct packed {
logic [CVA6Cfg.XLEN-1:0] cause; // cause of exception
logic [CVA6Cfg.XLEN-1:0] tval; // additional information of causing exception (e.g.: instruction causing it),
// address of LD/ST fault
logic [CVA6Cfg.GPLEN-1:0] tval2; // additional information when the causing exception in a guest exception
logic [31:0] tinst; // transformed instruction information
logic gva; // signals when a guest virtual address is written to tval
logic valid;
},
// cache request ports
// I$ address translation requests
localparam type icache_areq_t = struct packed {
logic fetch_valid; // address translation valid
logic [CVA6Cfg.PLEN-1:0] fetch_paddr; // physical address in
exception_t fetch_exception; // exception occurred during fetch
},
localparam type icache_arsp_t = struct packed {
logic fetch_req; // address translation request
logic [CVA6Cfg.VLEN-1:0] fetch_vaddr; // virtual address out
},
// I$ data requests
localparam type icache_dreq_t = struct packed {
logic req; // we request a new word
logic kill_s1; // kill the current request
logic kill_s2; // kill the last request
logic spec; // request is speculative
logic [CVA6Cfg.VLEN-1:0] vaddr; // 1st cycle: 12 bit index is taken for lookup
},
localparam type icache_drsp_t = struct packed {
logic ready; // icache is ready
logic valid; // signals a valid read
logic [CVA6Cfg.FETCH_WIDTH-1:0] data; // 2+ cycle out: tag
logic [CVA6Cfg.FETCH_USER_WIDTH-1:0] user; // User bits
logic [CVA6Cfg.VLEN-1:0] vaddr; // virtual address out
exception_t ex; // we've encountered an exception
},
// IF/ID Stage
// store the decompressed instruction
localparam type fetch_entry_t = struct packed {
logic [CVA6Cfg.VLEN-1:0] address; // the address of the instructions from below
logic [31:0] instruction; // instruction word
branchpredict_sbe_t branch_predict; // this field contains branch prediction information regarding the forward branch path
exception_t ex; // this field contains exceptions which might have happened earlier, e.g.: fetch exceptions
},
// ID/EX/WB Stage
localparam type scoreboard_entry_t = struct packed {
logic [CVA6Cfg.VLEN-1:0] pc; // PC of instruction
logic [CVA6Cfg.TRANS_ID_BITS-1:0] trans_id; // this can potentially be simplified, we could index the scoreboard entry
// with the transaction id in any case make the width more generic
fu_t fu; // functional unit to use
fu_op op; // operation to perform in each functional unit
logic [REG_ADDR_SIZE-1:0] rs1; // register source address 1
logic [REG_ADDR_SIZE-1:0] rs2; // register source address 2
logic [REG_ADDR_SIZE-1:0] rd; // register destination address
logic [CVA6Cfg.XLEN-1:0] result; // for unfinished instructions this field also holds the immediate,
// for unfinished floating-point that are partly encoded in rs2, this field also holds rs2
// for unfinished floating-point fused operations (FMADD, FMSUB, FNMADD, FNMSUB)
// this field holds the address of the third operand from the floating-point register file
logic valid; // is the result valid
logic use_imm; // should we use the immediate as operand b?
logic use_zimm; // use zimm as operand a
logic use_pc; // set if we need to use the PC as operand a, PC from exception
exception_t ex; // exception has occurred
branchpredict_sbe_t bp; // branch predict scoreboard data structure
logic is_compressed; // signals a compressed instructions, we need this information at the commit stage if
// we want jump accordingly e.g.: +4, +2
logic is_macro_instr; // is an instruction executed as predefined sequence of instructions called macro definition
logic is_last_macro_instr; // is last decoded 32bit instruction of macro definition
logic is_double_rd_macro_instr; // is double move decoded 32bit instruction of macro definition
logic vfp; // is this a vector floating-point instruction?
},
// branch-predict
// this is the struct we get back from ex stage and we will use it to update
// all the necessary data structures
// bp_resolve_t
localparam type bp_resolve_t = struct packed {
logic valid; // prediction with all its values is valid
logic [CVA6Cfg.VLEN-1:0] pc; // PC of predict or mis-predict
logic [CVA6Cfg.VLEN-1:0] target_address; // target address at which to jump, or not
logic is_mispredict; // set if this was a mis-predict
logic is_taken; // branch is taken
cf_t cf_type; // Type of control flow change
},
// All information needed to determine whether we need to associate an interrupt
// with the corresponding instruction or not.
localparam type irq_ctrl_t = struct packed {
logic [CVA6Cfg.XLEN-1:0] mie;
logic [CVA6Cfg.XLEN-1:0] mip;
logic [CVA6Cfg.XLEN-1:0] mideleg;
logic [CVA6Cfg.XLEN-1:0] hideleg;
logic sie;
logic global_enable;
},
localparam type lsu_ctrl_t = struct packed {
logic valid;
logic [CVA6Cfg.VLEN-1:0] vaddr;
logic [31:0] tinst;
logic hs_ld_st_inst;
logic hlvx_inst;
logic overflow;
logic g_overflow;
logic [CVA6Cfg.XLEN-1:0] data;
logic [(CVA6Cfg.XLEN/8)-1:0] be;
fu_t fu;
fu_op operation;
logic [CVA6Cfg.TRANS_ID_BITS-1:0] trans_id;
},
localparam type fu_data_t = struct packed {
fu_t fu;
fu_op operation;
logic [CVA6Cfg.XLEN-1:0] operand_a;
logic [CVA6Cfg.XLEN-1:0] operand_b;
logic [CVA6Cfg.XLEN-1:0] imm;
logic [CVA6Cfg.TRANS_ID_BITS-1:0] trans_id;
},
localparam type icache_req_t = struct packed {
logic [CVA6Cfg.ICACHE_SET_ASSOC_WIDTH-1:0] way; // way to replace
logic [CVA6Cfg.PLEN-1:0] paddr; // physical address
logic nc; // noncacheable
logic [CVA6Cfg.MEM_TID_WIDTH-1:0] tid; // threadi id (used as transaction id in Ariane)
},
localparam type icache_rtrn_t = struct packed {
wt_cache_pkg::icache_in_t rtype; // see definitions above
logic [CVA6Cfg.ICACHE_LINE_WIDTH-1:0] data; // full cache line width
logic [CVA6Cfg.ICACHE_USER_LINE_WIDTH-1:0] user; // user bits
struct packed {
logic vld; // invalidate only affected way
logic all; // invalidate all ways
logic [CVA6Cfg.ICACHE_INDEX_WIDTH-1:0] idx; // physical address to invalidate
logic [CVA6Cfg.ICACHE_SET_ASSOC_WIDTH-1:0] way; // way to invalidate
} inv; // invalidation vector
logic [CVA6Cfg.MEM_TID_WIDTH-1:0] tid; // threadi id (used as transaction id in Ariane)
},
// D$ data requests
localparam type dcache_req_i_t = struct packed {
logic [CVA6Cfg.DCACHE_INDEX_WIDTH-1:0] address_index;
logic [CVA6Cfg.DCACHE_TAG_WIDTH-1:0] address_tag;
logic [CVA6Cfg.XLEN-1:0] data_wdata;
logic [CVA6Cfg.DCACHE_USER_WIDTH-1:0] data_wuser;
logic data_req;
logic data_we;
logic [(CVA6Cfg.XLEN/8)-1:0] data_be;
logic [1:0] data_size;
logic [CVA6Cfg.DcacheIdWidth-1:0] data_id;
logic kill_req;
logic tag_valid;
},
localparam type dcache_req_o_t = struct packed {
logic data_gnt;
logic data_rvalid;
logic [CVA6Cfg.DcacheIdWidth-1:0] data_rid;
logic [CVA6Cfg.XLEN-1:0] data_rdata;
logic [CVA6Cfg.DCACHE_USER_WIDTH-1:0] data_ruser;
},
// AXI types
parameter type axi_ar_chan_t = struct packed {
logic [CVA6Cfg.AxiIdWidth-1:0] id;
logic [CVA6Cfg.AxiAddrWidth-1:0] addr;
axi_pkg::len_t len;
axi_pkg::size_t size;
axi_pkg::burst_t burst;
logic lock;
axi_pkg::cache_t cache;
axi_pkg::prot_t prot;
axi_pkg::qos_t qos;
axi_pkg::region_t region;
logic [CVA6Cfg.AxiUserWidth-1:0] user;
},
parameter type axi_aw_chan_t = struct packed {
logic [CVA6Cfg.AxiIdWidth-1:0] id;
logic [CVA6Cfg.AxiAddrWidth-1:0] addr;
axi_pkg::len_t len;
axi_pkg::size_t size;
axi_pkg::burst_t burst;
logic lock;
axi_pkg::cache_t cache;
axi_pkg::prot_t prot;
axi_pkg::qos_t qos;
axi_pkg::region_t region;
axi_pkg::atop_t atop;
logic [CVA6Cfg.AxiUserWidth-1:0] user;
},
parameter type axi_w_chan_t = struct packed {
logic [CVA6Cfg.AxiDataWidth-1:0] data;
logic [(CVA6Cfg.AxiDataWidth/8)-1:0] strb;
logic last;
logic [CVA6Cfg.AxiUserWidth-1:0] user;
},
parameter type b_chan_t = struct packed {
logic [CVA6Cfg.AxiIdWidth-1:0] id;
axi_pkg::resp_t resp;
logic [CVA6Cfg.AxiUserWidth-1:0] user;
},
parameter type r_chan_t = struct packed {
logic [CVA6Cfg.AxiIdWidth-1:0] id;
logic [CVA6Cfg.AxiDataWidth-1:0] data;
axi_pkg::resp_t resp;
logic last;
logic [CVA6Cfg.AxiUserWidth-1:0] user;
},
parameter type noc_req_t = struct packed {
axi_aw_chan_t aw;
logic aw_valid;
axi_w_chan_t w;
logic w_valid;
logic b_ready;
axi_ar_chan_t ar;
logic ar_valid;
logic r_ready;
},
parameter type noc_resp_t = struct packed {
logic aw_ready;
logic ar_ready;
logic w_ready;
logic b_valid;
b_chan_t b;
logic r_valid;
r_chan_t r;
},
//
parameter type acc_cfg_t = logic,
parameter acc_cfg_t AccCfg = '0,
// CVXIF Types
parameter type readregflags_t = `READREGFLAGS_T(CVA6Cfg),
parameter type writeregflags_t = `WRITEREGFLAGS_T(CVA6Cfg),
parameter type id_t = `ID_T(CVA6Cfg),
parameter type hartid_t = `HARTID_T(CVA6Cfg),
parameter type x_compressed_req_t = `X_COMPRESSED_REQ_T(CVA6Cfg, hartid_t),
parameter type x_compressed_resp_t = `X_COMPRESSED_RESP_T(CVA6Cfg),
parameter type x_issue_req_t = `X_ISSUE_REQ_T(CVA6Cfg, hartit_t, id_t),
parameter type x_issue_resp_t = `X_ISSUE_RESP_T(CVA6Cfg, writeregflags_t, readregflags_t),
parameter type x_register_t = `X_REGISTER_T(CVA6Cfg, hartid_t, id_t, readregflags_t),
parameter type x_commit_t = `X_COMMIT_T(CVA6Cfg, hartid_t, id_t),
parameter type x_result_t = `X_RESULT_T(CVA6Cfg, hartid_t, id_t, writeregflags_t),
parameter type cvxif_req_t =
`CVXIF_REQ_T(CVA6Cfg, x_compressed_req_t, x_issue_req_t, x_register_req_t, x_commit_t),
parameter type cvxif_resp_t =
`CVXIF_RESP_T(CVA6Cfg, x_compressed_resp_t, x_issue_resp_t, x_result_t)
) (
// Subsystem Clock - SUBSYSTEM
input logic clk_i,
// Asynchronous reset active low - SUBSYSTEM
input logic rst_ni,
// Reset boot address - SUBSYSTEM
input logic [CVA6Cfg.VLEN-1:0] boot_addr_i,
// Hard ID reflected as CSR - SUBSYSTEM
input logic [CVA6Cfg.XLEN-1:0] hart_id_i,
// Level sensitive (async) interrupts - SUBSYSTEM
input logic [1:0] irq_i,
// Inter-processor (async) interrupt - SUBSYSTEM
input logic ipi_i,
// Timer (async) interrupt - SUBSYSTEM
input logic time_irq_i,
// Debug (async) request - SUBSYSTEM
input logic debug_req_i,
// CLIC interface
input logic clic_irq_valid_i, // CLIC interrupt request
input logic [$clog2(CVA6Cfg.CLICNumInterruptSrc)-1:0] clic_irq_id_i, // interrupt source ID
input logic [7:0] clic_irq_level_i, // interrupt level is 8-bit from CLIC spec
input riscv::priv_lvl_t clic_irq_priv_i, // CLIC interrupt privilege level
input logic clic_irq_shv_i, // selective hardware vectoring bit
output logic clic_irq_ready_o, // core side interrupt hanshake (ready)
input logic clic_kill_req_i, // kill request
output logic clic_kill_ack_o, // kill acknowledge
// Probes to build RVFI, can be left open when not used - RVFI
output rvfi_probes_t rvfi_probes_o,
// CVXIF request - SUBSYSTEM
output cvxif_req_t cvxif_req_o,
// CVXIF response - SUBSYSTEM
input cvxif_resp_t cvxif_resp_i,
// noc request, can be AXI or OpenPiton - SUBSYSTEM
output noc_req_t noc_req_o,
// noc response, can be AXI or OpenPiton - SUBSYSTEM
input noc_resp_t noc_resp_i
);
localparam type interrupts_t = struct packed {
logic [CVA6Cfg.XLEN-1:0] S_SW;
logic [CVA6Cfg.XLEN-1:0] VS_SW;
logic [CVA6Cfg.XLEN-1:0] M_SW;
logic [CVA6Cfg.XLEN-1:0] S_TIMER;
logic [CVA6Cfg.XLEN-1:0] VS_TIMER;
logic [CVA6Cfg.XLEN-1:0] M_TIMER;
logic [CVA6Cfg.XLEN-1:0] S_EXT;
logic [CVA6Cfg.XLEN-1:0] VS_EXT;
logic [CVA6Cfg.XLEN-1:0] M_EXT;
logic [CVA6Cfg.XLEN-1:0] HS_EXT;
};
localparam interrupts_t INTERRUPTS = '{
S_SW: (1 << (CVA6Cfg.XLEN - 1)) | CVA6Cfg.XLEN'(riscv::IRQ_S_SOFT),
VS_SW: (1 << (CVA6Cfg.XLEN - 1)) | CVA6Cfg.XLEN'(riscv::IRQ_VS_SOFT),
M_SW: (1 << (CVA6Cfg.XLEN - 1)) | CVA6Cfg.XLEN'(riscv::IRQ_M_SOFT),
S_TIMER: (1 << (CVA6Cfg.XLEN - 1)) | CVA6Cfg.XLEN'(riscv::IRQ_S_TIMER),
VS_TIMER: (1 << (CVA6Cfg.XLEN - 1)) | CVA6Cfg.XLEN'(riscv::IRQ_VS_TIMER),
M_TIMER: (1 << (CVA6Cfg.XLEN - 1)) | CVA6Cfg.XLEN'(riscv::IRQ_M_TIMER),
S_EXT: (1 << (CVA6Cfg.XLEN - 1)) | CVA6Cfg.XLEN'(riscv::IRQ_S_EXT),
VS_EXT: (1 << (CVA6Cfg.XLEN - 1)) | CVA6Cfg.XLEN'(riscv::IRQ_VS_EXT),
M_EXT: (1 << (CVA6Cfg.XLEN - 1)) | CVA6Cfg.XLEN'(riscv::IRQ_M_EXT),
HS_EXT: (1 << (CVA6Cfg.XLEN - 1)) | CVA6Cfg.XLEN'(riscv::IRQ_HS_EXT)
};
// ------------------------------------------
// Global Signals
// Signals connecting more than one module
// ------------------------------------------
riscv::priv_lvl_t priv_lvl;
logic v;
exception_t ex_commit; // exception from commit stage
bp_resolve_t resolved_branch;
logic [ CVA6Cfg.VLEN-1:0] pc_commit;
logic eret;
logic [CVA6Cfg.NrCommitPorts-1:0] commit_ack;
logic [CVA6Cfg.NrCommitPorts-1:0] commit_macro_ack;
logic rst_uarch_n;
localparam NumPorts = 4;
// CVXIF
cvxif_req_t cvxif_req;
// CVXIF OUTPUTS
logic x_compressed_valid;
x_compressed_req_t x_compressed_req;
logic x_issue_valid;
x_issue_req_t x_issue_req;
logic x_register_valid;
x_register_t x_register;
logic x_commit_valid;
x_commit_t x_commit;
logic x_result_ready;
// CVXIF INPUTS
logic x_compressed_ready;
x_compressed_resp_t x_compressed_resp;
logic x_issue_ready;
x_issue_resp_t x_issue_resp;
logic x_register_ready;
logic x_result_valid;
x_result_t x_result;
// --------------
// PCGEN <-> CSR
// --------------
logic [CVA6Cfg.VLEN-1:0] trap_vector_base_commit_pcgen;
logic [CVA6Cfg.VLEN-1:0] epc_commit_pcgen;
// --------------
// IF <-> ID
// --------------
fetch_entry_t [CVA6Cfg.NrIssuePorts-1:0] fetch_entry_if_id;
logic [CVA6Cfg.NrIssuePorts-1:0] fetch_valid_if_id;
logic [CVA6Cfg.NrIssuePorts-1:0] fetch_ready_id_if;
// --------------
// ID <-> ISSUE
// --------------
scoreboard_entry_t [CVA6Cfg.NrIssuePorts-1:0] issue_entry_id_issue;
logic [CVA6Cfg.NrIssuePorts-1:0][31:0] orig_instr_id_issue;
logic [CVA6Cfg.NrIssuePorts-1:0] issue_entry_valid_id_issue;
logic [CVA6Cfg.NrIssuePorts-1:0] is_ctrl_fow_id_issue;
logic [CVA6Cfg.NrIssuePorts-1:0] issue_instr_issue_id;
// --------------
// ISSUE <-> EX
// --------------
logic [CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0] rs1_forwarding_id_ex; // unregistered version of fu_data_o.operanda
logic [CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0] rs2_forwarding_id_ex; // unregistered version of fu_data_o.operandb
fu_data_t [CVA6Cfg.NrIssuePorts-1:0] fu_data_id_ex;
logic [CVA6Cfg.VLEN-1:0] pc_id_ex;
logic is_compressed_instr_id_ex;
logic [CVA6Cfg.NrIssuePorts-1:0][31:0] tinst_ex;
// fixed latency units
logic flu_ready_ex_id;
logic [CVA6Cfg.TRANS_ID_BITS-1:0] flu_trans_id_ex_id;
logic flu_valid_ex_id;
logic [CVA6Cfg.XLEN-1:0] flu_result_ex_id;
exception_t flu_exception_ex_id;
// ALU
logic [CVA6Cfg.NrIssuePorts-1:0] alu_valid_id_ex;
// Branches and Jumps
logic [CVA6Cfg.NrIssuePorts-1:0] branch_valid_id_ex;
branchpredict_sbe_t branch_predict_id_ex;
logic resolve_branch_ex_id;
// LSU
logic [CVA6Cfg.NrIssuePorts-1:0] lsu_valid_id_ex;
logic lsu_ready_ex_id;
logic [CVA6Cfg.TRANS_ID_BITS-1:0] load_trans_id_ex_id;
logic [CVA6Cfg.XLEN-1:0] load_result_ex_id;
logic load_valid_ex_id;
exception_t load_exception_ex_id;
logic [CVA6Cfg.XLEN-1:0] store_result_ex_id;
logic [CVA6Cfg.TRANS_ID_BITS-1:0] store_trans_id_ex_id;
logic store_valid_ex_id;
exception_t store_exception_ex_id;
// MULT
logic [CVA6Cfg.NrIssuePorts-1:0] mult_valid_id_ex;
// FPU
logic fpu_ready_ex_id;
logic [CVA6Cfg.NrIssuePorts-1:0] fpu_valid_id_ex;
logic [1:0] fpu_fmt_id_ex;
logic [2:0] fpu_rm_id_ex;
logic [CVA6Cfg.TRANS_ID_BITS-1:0] fpu_trans_id_ex_id;
logic [CVA6Cfg.XLEN-1:0] fpu_result_ex_id;
logic fpu_valid_ex_id;
exception_t fpu_exception_ex_id;
// ALU2
logic [CVA6Cfg.NrIssuePorts-1:0] alu2_valid_id_ex;
// Accelerator
logic stall_acc_id;
scoreboard_entry_t issue_instr_id_acc;
logic issue_instr_hs_id_acc;
logic [CVA6Cfg.TRANS_ID_BITS-1:0] acc_trans_id_ex_id;
logic [CVA6Cfg.XLEN-1:0] acc_result_ex_id;
logic acc_valid_ex_id;
exception_t acc_exception_ex_id;
logic halt_acc_ctrl;
logic [4:0] acc_resp_fflags;
logic acc_resp_fflags_valid;
logic single_step_acc_commit;
// CSR
logic [CVA6Cfg.NrIssuePorts-1:0] csr_valid_id_ex;
logic csr_hs_ld_st_inst_ex;
// CVXIF
logic [CVA6Cfg.TRANS_ID_BITS-1:0] x_trans_id_ex_id;
logic [CVA6Cfg.XLEN-1:0] x_result_ex_id;
logic x_valid_ex_id;
exception_t x_exception_ex_id;
logic x_we_ex_id;
logic [4:0] x_rd_ex_id;
logic [CVA6Cfg.NrIssuePorts-1:0] x_issue_valid_id_ex;
logic x_issue_ready_ex_id;
logic [31:0] x_off_instr_id_ex;
logic x_transaction_rejected;
// --------------
// EX <-> COMMIT
// --------------
// CSR Commit
logic csr_commit_commit_ex;
logic dirty_fp_state;
logic dirty_v_state;
// LSU Commit
logic lsu_commit_commit_ex;
logic lsu_commit_ready_ex_commit;
logic [CVA6Cfg.TRANS_ID_BITS-1:0] lsu_commit_trans_id;
logic stall_st_pending_ex;
logic no_st_pending_ex;
logic no_st_pending_commit;
logic amo_valid_commit;
// ACCEL Commit
logic acc_valid_acc_ex;
// --------------
// ID <-> COMMIT
// --------------
scoreboard_entry_t [CVA6Cfg.NrCommitPorts-1:0] commit_instr_id_commit;
logic [CVA6Cfg.NrCommitPorts-1:0] commit_drop_id_commit;
logic [CVA6Cfg.NrCommitPorts-1:0] commit_ack_commit_id;
// --------------
// RVFI
// --------------
logic [CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.TRANS_ID_BITS-1:0] rvfi_issue_pointer;
logic [CVA6Cfg.NrCommitPorts-1:0][CVA6Cfg.TRANS_ID_BITS-1:0] rvfi_commit_pointer;
// --------------
// COMMIT <-> ID
// --------------
logic [CVA6Cfg.NrCommitPorts-1:0][4:0] waddr_commit_id;
logic [CVA6Cfg.NrCommitPorts-1:0][CVA6Cfg.XLEN-1:0] wdata_commit_id;
logic [CVA6Cfg.NrCommitPorts-1:0] we_gpr_commit_id;
logic [CVA6Cfg.NrCommitPorts-1:0] we_fpr_commit_id;
// --------------
// CSR <-> *
// --------------
logic [4:0] fflags_csr_commit;
riscv::xs_t fs;
riscv::xs_t vfs;
logic [2:0] frm_csr_id_issue_ex;
logic [6:0] fprec_csr_ex;
riscv::xs_t vs;
logic enable_translation_csr_ex;
logic enable_g_translation_csr_ex;
logic en_ld_st_translation_csr_ex;
logic en_ld_st_g_translation_csr_ex;
riscv::priv_lvl_t ld_st_priv_lvl_csr_ex;
logic ld_st_v_csr_ex;
logic sum_csr_ex;
logic vs_sum_csr_ex;
logic mxr_csr_ex;
logic vmxr_csr_ex;
logic [CVA6Cfg.PPNW-1:0] satp_ppn_csr_ex;
logic [CVA6Cfg.ASID_WIDTH-1:0] asid_csr_ex;
logic [CVA6Cfg.PPNW-1:0] vsatp_ppn_csr_ex;
logic [CVA6Cfg.ASID_WIDTH-1:0] vs_asid_csr_ex;
logic [CVA6Cfg.PPNW-1:0] hgatp_ppn_csr_ex;
logic [CVA6Cfg.VMID_WIDTH-1:0] vmid_csr_ex;
logic [11:0] csr_addr_ex_csr;
fu_op csr_op_commit_csr;
logic [CVA6Cfg.XLEN-1:0] csr_wdata_commit_csr;
logic [CVA6Cfg.XLEN-1:0] csr_rdata_csr_commit;
exception_t csr_exception_csr_commit;
logic tvm_csr_id;
logic tw_csr_id;
logic vtw_csr_id;
logic tsr_csr_id;
logic hu;
irq_ctrl_t irq_ctrl_csr_id;
logic clic_mode;
riscv::intstatus_rv_t mintstatus_csr;
logic [7:0] mintthresh_csr;
logic [7:0] sintthresh_csr;
logic dcache_en_csr_nbdcache;
logic csr_write_fflags_commit_cs;
logic icache_en_csr;
logic acc_cons_en_csr;
logic [31:0] fence_t_pad_csr_ctrl;
logic fence_t_src_sel_csr_ctrl;
logic [31:0] fence_t_ceil_csr_ctrl;
logic debug_mode;
logic single_step_csr_commit;
riscv::pmpcfg_t [CVA6Cfg.NrPMPEntries-1:0] pmpcfg;
logic [CVA6Cfg.NrPMPEntries-1:0][CVA6Cfg.PLEN-3:0] pmpaddr;
logic [31:0] mcountinhibit_csr_perf;
// ----------------------------
// Performance Counters <-> *
// ----------------------------
logic [11:0] addr_csr_perf;
logic [CVA6Cfg.XLEN-1:0] data_csr_perf, data_perf_csr;
logic we_csr_perf;
logic icache_flush_ctrl_cache;
logic itlb_miss_ex_perf;
logic dtlb_miss_ex_perf;
logic dcache_miss_cache_perf;
logic icache_miss_cache_perf;
logic [NumPorts-1:0][CVA6Cfg.DCACHE_SET_ASSOC-1:0] miss_vld_bits;
logic stall_issue;
// --------------
// CTRL <-> *
// --------------
logic set_pc_ctrl_pcgen;
logic flush_csr_ctrl;
logic flush_unissued_instr_ctrl_id;
logic flush_ctrl_if;
logic flush_ctrl_id;
logic flush_ctrl_ex;
logic flush_ctrl_bp;
logic flush_tlb_ctrl_ex;
logic flush_tlb_vvma_ctrl_ex;
logic flush_tlb_gvma_ctrl_ex;
logic fence_i_commit_controller;
logic fence_commit_controller;
logic sfence_vma_commit_controller;
logic hfence_vvma_commit_controller;
logic hfence_gvma_commit_controller;
logic fence_t_commit_controller;
logic halt_ctrl;
logic halt_csr_ctrl;
logic dcache_flush_ctrl_cache;
logic dcache_flush_ack_cache_ctrl;
logic set_debug_pc;
logic flush_commit;
logic flush_acc;
logic rst_uarch_controller_n;
logic [CVA6Cfg.VLEN-1:0] rst_addr_ctrl_if;
logic busy_cache_ctrl;
logic stall_ctrl_cache;
logic init_ctrl_cache_n;
icache_areq_t icache_areq_ex_cache;
icache_arsp_t icache_areq_cache_ex;
icache_dreq_t icache_dreq_if_cache;
icache_drsp_t icache_dreq_cache_if;
amo_req_t amo_req;
amo_resp_t amo_resp;
logic sb_full;
// ----------------
// DCache <-> *
// ----------------
dcache_req_i_t [2:0] dcache_req_ports_ex_cache;
dcache_req_o_t [2:0] dcache_req_ports_cache_ex;
dcache_req_i_t [1:0] dcache_req_ports_acc_cache;
dcache_req_o_t [1:0] dcache_req_ports_cache_acc;
logic dcache_commit_wbuffer_empty;
logic dcache_commit_wbuffer_not_ni;
//RVFI
lsu_ctrl_t rvfi_lsu_ctrl;
logic [CVA6Cfg.PLEN-1:0] rvfi_mem_paddr;
logic [CVA6Cfg.NrIssuePorts-1:0] rvfi_is_compressed;
rvfi_probes_csr_t rvfi_csr;
// Accelerator port
logic [63:0] inval_addr;
logic inval_valid;
logic inval_ready;
always_ff @(posedge clk_i or negedge rst_ni) begin
if (~rst_ni) begin
rst_uarch_n <= 1'b0;
end else begin
rst_uarch_n <= rst_uarch_controller_n;
end
end
// ----------------------
// CLIC Controller <-> ID
// ----------------------
logic clic_irq_req_id;
logic [CVA6Cfg.XLEN-1:0] clic_irq_cause_id;
// --------------
// Frontend
// --------------
frontend #(
.CVA6Cfg(CVA6Cfg),
.bp_resolve_t(bp_resolve_t),
.fetch_entry_t(fetch_entry_t),
.icache_dreq_t(icache_dreq_t),
.icache_drsp_t(icache_drsp_t)
) i_frontend (
.rst_ni (rst_uarch_n),
.flush_i (flush_ctrl_if), // not entirely correct
.flush_bp_i (1'b0),
.halt_i (halt_ctrl),
.debug_mode_i (debug_mode),
.boot_addr_i (rst_addr_ctrl_if),
.icache_dreq_i (icache_dreq_cache_if),
.icache_dreq_o (icache_dreq_if_cache),
.resolved_branch_i (resolved_branch),
.pc_commit_i (pc_commit),
.set_pc_commit_i (set_pc_ctrl_pcgen),
.set_debug_pc_i (set_debug_pc),
.epc_i (epc_commit_pcgen),
.eret_i (eret),
.trap_vector_base_i (trap_vector_base_commit_pcgen),
.ex_valid_i (ex_commit.valid),
.fetch_entry_o (fetch_entry_if_id),
.fetch_entry_valid_o(fetch_valid_if_id),
.fetch_entry_ready_i(fetch_ready_id_if),
.*
);
// ---------
// ID
// ---------
id_stage #(
.CVA6Cfg(CVA6Cfg),
.branchpredict_sbe_t(branchpredict_sbe_t),
.exception_t(exception_t),
.fetch_entry_t(fetch_entry_t),
.irq_ctrl_t(irq_ctrl_t),
.scoreboard_entry_t(scoreboard_entry_t),
.interrupts_t(interrupts_t),
.INTERRUPTS(INTERRUPTS),
.x_compressed_req_t(x_compressed_req_t),
.x_compressed_resp_t(x_compressed_resp_t)
) id_stage_i (
.clk_i,
.rst_ni (rst_uarch_n),
.flush_i(flush_ctrl_if),
.debug_req_i,
.fetch_entry_i (fetch_entry_if_id),
.fetch_entry_valid_i(fetch_valid_if_id),
.fetch_entry_ready_o(fetch_ready_id_if),
.issue_entry_o (issue_entry_id_issue),
.orig_instr_o (orig_instr_id_issue),
.issue_entry_valid_o(issue_entry_valid_id_issue),
.is_ctrl_flow_o (is_ctrl_fow_id_issue),
.issue_instr_ack_i (issue_instr_issue_id),
.rvfi_is_compressed_o(rvfi_is_compressed),
.priv_lvl_i (priv_lvl),
.v_i (v),
.fs_i (fs),
.vfs_i (vfs),
.frm_i (frm_csr_id_issue_ex),
.vs_i (vs),
.irq_i (irq_i),
.irq_ctrl_i (irq_ctrl_csr_id),
.clic_mode_i (clic_mode),
.clic_irq_req_i (clic_irq_req_id),
.clic_irq_cause_i (clic_irq_cause_id),
.debug_mode_i (debug_mode),
.tvm_i (tvm_csr_id),
.tw_i (tw_csr_id),
.vtw_i (vtw_csr_id),
.tsr_i (tsr_csr_id),
.hu_i (hu),
.hart_id_i (hart_id_i),
.compressed_ready_i(x_compressed_ready),
.compressed_resp_i (x_compressed_resp),
.compressed_valid_o(x_compressed_valid),
.compressed_req_o (x_compressed_req)
);
logic [CVA6Cfg.NrWbPorts-1:0][CVA6Cfg.TRANS_ID_BITS-1:0] trans_id_ex_id;
logic [CVA6Cfg.NrWbPorts-1:0][CVA6Cfg.XLEN-1:0] wbdata_ex_id;
exception_t [CVA6Cfg.NrWbPorts-1:0] ex_ex_ex_id; // exception from execute, ex_stage to id_stage
logic [CVA6Cfg.NrWbPorts-1:0] wt_valid_ex_id;
assign trans_id_ex_id[FLU_WB] = flu_trans_id_ex_id;
assign wbdata_ex_id[FLU_WB] = flu_result_ex_id;
assign ex_ex_ex_id[FLU_WB] = flu_exception_ex_id;
assign wt_valid_ex_id[FLU_WB] = flu_valid_ex_id;
assign trans_id_ex_id[STORE_WB] = store_trans_id_ex_id;
assign wbdata_ex_id[STORE_WB] = store_result_ex_id;
assign ex_ex_ex_id[STORE_WB] = store_exception_ex_id;
assign wt_valid_ex_id[STORE_WB] = store_valid_ex_id;
assign trans_id_ex_id[LOAD_WB] = load_trans_id_ex_id;
assign wbdata_ex_id[LOAD_WB] = load_result_ex_id;
assign ex_ex_ex_id[LOAD_WB] = load_exception_ex_id;
assign wt_valid_ex_id[LOAD_WB] = load_valid_ex_id;
assign trans_id_ex_id[FPU_WB] = fpu_trans_id_ex_id;
assign wbdata_ex_id[FPU_WB] = fpu_result_ex_id;
assign ex_ex_ex_id[FPU_WB] = fpu_exception_ex_id;
assign wt_valid_ex_id[FPU_WB] = fpu_valid_ex_id;
always_comb begin : gen_cvxif_input_assignement
x_compressed_ready = cvxif_resp_i.compressed_ready;
x_compressed_resp = cvxif_resp_i.compressed_resp;
x_issue_ready = cvxif_resp_i.issue_ready;
x_issue_resp = cvxif_resp_i.issue_resp;
x_register_ready = cvxif_resp_i.register_ready;
x_result_valid = cvxif_resp_i.result_valid;
x_result = cvxif_resp_i.result;
end
if (CVA6Cfg.CvxifEn) begin
always_comb begin : gen_cvxif_output_assignement
cvxif_req.compressed_valid = x_compressed_valid;
cvxif_req.compressed_req = x_compressed_req;
cvxif_req.issue_valid = x_issue_valid;
cvxif_req.issue_req = x_issue_req;
cvxif_req.register_valid = x_register_valid;
cvxif_req.register = x_register;
cvxif_req.commit_valid = x_commit_valid;
cvxif_req.commit = x_commit;
cvxif_req.result_ready = x_result_ready;
end
assign trans_id_ex_id[X_WB] = x_trans_id_ex_id;
assign wbdata_ex_id[X_WB] = x_result_ex_id;
assign ex_ex_ex_id[X_WB] = x_exception_ex_id;
assign wt_valid_ex_id[X_WB] = x_valid_ex_id;
end else if (CVA6Cfg.EnableAccelerator) begin
assign cvxif_req = '0;
assign trans_id_ex_id[ACC_WB] = acc_trans_id_ex_id;
assign wbdata_ex_id[ACC_WB] = acc_result_ex_id;
assign ex_ex_ex_id[ACC_WB] = acc_exception_ex_id;
assign wt_valid_ex_id[ACC_WB] = acc_valid_ex_id;
end else begin
assign cvxif_req = '0;
end
if (CVA6Cfg.CvxifEn && CVA6Cfg.EnableAccelerator) begin : gen_err_xif_and_acc
$error("X-interface and accelerator port cannot be enabled at the same time.");
end
// ---------
// Issue
// ---------
issue_stage #(
.CVA6Cfg(CVA6Cfg),
.bp_resolve_t(bp_resolve_t),
.branchpredict_sbe_t(branchpredict_sbe_t),
.exception_t(exception_t),
.fu_data_t(fu_data_t),
.scoreboard_entry_t(scoreboard_entry_t),
.x_issue_req_t(x_issue_req_t),
.x_issue_resp_t(x_issue_resp_t),
.x_register_t(x_register_t),
.x_commit_t(x_commit_t)
) issue_stage_i (
.clk_i,
.rst_ni,
.rst_uarch_ni (rst_uarch_n),
.sb_full_o (sb_full),
.flush_unissued_instr_i (flush_unissued_instr_ctrl_id),
.flush_i (flush_ctrl_id),
.stall_i (stall_acc_id),
// ID Stage
.decoded_instr_i (issue_entry_id_issue),
.orig_instr_i (orig_instr_id_issue),
.decoded_instr_valid_i (issue_entry_valid_id_issue),
.is_ctrl_flow_i (is_ctrl_fow_id_issue),
.decoded_instr_ack_o (issue_instr_issue_id),
// Functional Units
.rs1_forwarding_o (rs1_forwarding_id_ex),
.rs2_forwarding_o (rs2_forwarding_id_ex),
.fu_data_o (fu_data_id_ex),
.pc_o (pc_id_ex),
.is_compressed_instr_o (is_compressed_instr_id_ex),
.tinst_o (tinst_ex),
// fixed latency unit ready
.flu_ready_i (flu_ready_ex_id),
// ALU
.alu_valid_o (alu_valid_id_ex),
// Branches and Jumps
.branch_valid_o (branch_valid_id_ex), // branch is valid
.branch_predict_o (branch_predict_id_ex), // branch predict to ex
.resolve_branch_i (resolve_branch_ex_id), // in order to resolve the branch
// LSU
.lsu_ready_i (lsu_ready_ex_id),
.lsu_valid_o (lsu_valid_id_ex),
// Multiplier
.mult_valid_o (mult_valid_id_ex),
// FPU
.fpu_ready_i (fpu_ready_ex_id),
.fpu_valid_o (fpu_valid_id_ex),
.fpu_fmt_o (fpu_fmt_id_ex),
.fpu_rm_o (fpu_rm_id_ex),
// ALU2
.alu2_valid_o (alu2_valid_id_ex),
// CSR
.csr_valid_o (csr_valid_id_ex),
// CVXIF
.xfu_valid_o (x_issue_valid_id_ex),
.xfu_ready_i (x_issue_ready_ex_id),
.x_off_instr_o (x_off_instr_id_ex),
.hart_id_i (hart_id_i),
.x_issue_ready_i (x_issue_ready),
.x_issue_resp_i (x_issue_resp),
.x_issue_valid_o (x_issue_valid),
.x_issue_req_o (x_issue_req),
.x_register_ready_i (x_register_ready),
.x_register_valid_o (x_register_valid),
.x_register_o (x_register),
.x_commit_valid_o (x_commit_valid),
.x_commit_o (x_commit),
.x_transaction_rejected_o(x_transaction_rejected),
// Accelerator
.issue_instr_o (issue_instr_id_acc),
.issue_instr_hs_o (issue_instr_hs_id_acc),
// Commit
.resolved_branch_i (resolved_branch),
.trans_id_i (trans_id_ex_id),
.wbdata_i (wbdata_ex_id),
.ex_ex_i (ex_ex_ex_id),
.wt_valid_i (wt_valid_ex_id),
.x_we_i (x_we_ex_id),
.x_rd_i (x_rd_ex_id),
.waddr_i (waddr_commit_id),
.wdata_i (wdata_commit_id),
.we_gpr_i (we_gpr_commit_id),
.we_fpr_i (we_fpr_commit_id),
.commit_instr_o (commit_instr_id_commit),
.commit_drop_o (commit_drop_id_commit),
.commit_ack_i (commit_ack_commit_id),
// Performance Counters
.stall_issue_o (stall_issue),
//RVFI
.rvfi_issue_pointer_o (rvfi_issue_pointer),
.rvfi_commit_pointer_o(rvfi_commit_pointer),
.*
);
// ---------
// EX
// ---------
ex_stage #(
.CVA6Cfg (CVA6Cfg),
.bp_resolve_t(bp_resolve_t),
.branchpredict_sbe_t(branchpredict_sbe_t),
.dcache_req_i_t(dcache_req_i_t),
.dcache_req_o_t(dcache_req_o_t),
.exception_t(exception_t),
.fu_data_t(fu_data_t),
.icache_areq_t(icache_areq_t),
.icache_arsp_t(icache_arsp_t),
.icache_dreq_t(icache_dreq_t),
.icache_drsp_t(icache_drsp_t),
.lsu_ctrl_t(lsu_ctrl_t),
.x_result_t(x_result_t)
) ex_stage_i (
.clk_i(clk_i),
.rst_ni(rst_uarch_n),
.debug_mode_i(debug_mode),
.flush_i(flush_ctrl_ex),
.rs1_forwarding_i(rs1_forwarding_id_ex),
.rs2_forwarding_i(rs2_forwarding_id_ex),
.fu_data_i(fu_data_id_ex),
.pc_i(pc_id_ex),
.is_compressed_instr_i(is_compressed_instr_id_ex),
.tinst_i(tinst_ex),
// fixed latency units
.flu_result_o(flu_result_ex_id),
.flu_trans_id_o(flu_trans_id_ex_id),
.flu_valid_o(flu_valid_ex_id),
.flu_exception_o(flu_exception_ex_id),
.flu_ready_o(flu_ready_ex_id),
// ALU
.alu_valid_i(alu_valid_id_ex),
// Branches and Jumps
.branch_valid_i(branch_valid_id_ex),
.branch_predict_i(branch_predict_id_ex), // branch predict to ex
.resolved_branch_o(resolved_branch),
.resolve_branch_o(resolve_branch_ex_id),
// CSR
.csr_valid_i(csr_valid_id_ex),
.csr_addr_o(csr_addr_ex_csr),
.csr_commit_i(csr_commit_commit_ex), // from commit
.csr_hs_ld_st_inst_o(csr_hs_ld_st_inst_ex), // signals a Hypervisor Load/Store Instruction
// MULT
.mult_valid_i(mult_valid_id_ex),
// LSU
.lsu_ready_o(lsu_ready_ex_id),
.lsu_valid_i(lsu_valid_id_ex),
.load_result_o (load_result_ex_id),
.load_trans_id_o (load_trans_id_ex_id),
.load_valid_o (load_valid_ex_id),
.load_exception_o(load_exception_ex_id),
.store_result_o (store_result_ex_id),
.store_trans_id_o (store_trans_id_ex_id),
.store_valid_o (store_valid_ex_id),
.store_exception_o(store_exception_ex_id),
.lsu_commit_i (lsu_commit_commit_ex), // from commit
.lsu_commit_ready_o (lsu_commit_ready_ex_commit), // to commit
.commit_tran_id_i (lsu_commit_trans_id), // from commit
.stall_st_pending_i (stall_st_pending_ex),
.no_st_pending_o (no_st_pending_ex),
// FPU
.fpu_ready_o (fpu_ready_ex_id),
.fpu_valid_i (fpu_valid_id_ex),
.fpu_fmt_i (fpu_fmt_id_ex),
.fpu_rm_i (fpu_rm_id_ex),
.fpu_frm_i (frm_csr_id_issue_ex),
.fpu_prec_i (fprec_csr_ex),
.fpu_trans_id_o (fpu_trans_id_ex_id),
.fpu_result_o (fpu_result_ex_id),
.fpu_valid_o (fpu_valid_ex_id),
.fpu_exception_o (fpu_exception_ex_id),
// ALU2
.alu2_valid_i (alu2_valid_id_ex),
.amo_valid_commit_i (amo_valid_commit),
.amo_req_o (amo_req),
.amo_resp_i (amo_resp),