Skip to content

Commit

Permalink
Update VeeR codebase
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Kurc <[email protected]>
  • Loading branch information
mkurc-ant committed May 26, 2023
1 parent 02f97ac commit 786d57c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/integration/rtl/caliptra_top.sv
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ el2_veer_wrapper rvtop (
.soft_int (soft_int),
.core_id ('0),
.scan_mode ( cptra_scan_mode_Latched ), // To enable scan mode
.scan_rst_l ( 1'b1 ),
.mbist_mode ( 1'b0 ) // to enable mbist

);
Expand Down
7 changes: 4 additions & 3 deletions src/riscv_core/veer_el2/rtl/el2_veer.sv
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import el2_pkg::*;
input logic [31:1] rst_vec,
input logic nmi_int,
input logic [31:1] nmi_vec,
output logic core_rst_l, // This is "rst_l | dbg_rst_l"
output logic core_rst_l, // This is "rst_l & (scan_rst_l | scan_mode)"

output logic active_l2clk,
output logic free_l2clk,
Expand Down Expand Up @@ -380,7 +380,8 @@ import el2_pkg::*;
input logic [pt.PIC_TOTAL_INT:1] extintsrc_req,
input logic timer_int,
input logic soft_int,
input logic scan_mode
input logic scan_mode,
input logic scan_rst_l
);


Expand Down Expand Up @@ -856,7 +857,7 @@ import el2_pkg::*;

// ----------------- DEBUG END -----------------------------

assign core_rst_l = rst_l & (dbg_core_rst_l | scan_mode);
assign core_rst_l = rst_l & (scan_rst_l | scan_mode);
// fetch
el2_ifu #(.pt(pt)) ifu (
.clk(active_l2clk),
Expand Down
1 change: 1 addition & 0 deletions src/riscv_core/veer_el2/rtl/el2_veer_wrapper.sv
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ import soc_ifc_pkg::*;
input logic i_cpu_run_req, // Async restart req to CPU
output logic o_cpu_run_ack, // Core response to run req
input logic scan_mode, // To enable scan mode
input logic scan_rst_l,
input logic mbist_mode // to enable mbist
);

Expand Down
27 changes: 18 additions & 9 deletions src/riscv_core/veer_el2/rtl/lib/beh_lib.sv
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ endmodule
// special power flop for predict packet
// format: { LEFT, RIGHT==31 }
// LEFT # of bits will be done with rvdffe; RIGHT is enabled by LEFT[LSB] & en
module rvdffppe #( parameter WIDTH=32 )
module rvdffppe #( parameter integer WIDTH = 39 )
(
input logic [WIDTH-1:0] din,
input logic clk,
Expand All @@ -301,13 +301,13 @@ module rvdffppe #( parameter WIDTH=32 )
output logic [WIDTH-1:0] dout
);

localparam RIGHT = 31;
localparam LEFT = WIDTH - RIGHT;
localparam integer RIGHT = 31;
localparam integer LEFT = WIDTH - RIGHT;

localparam LMSB = WIDTH-1;
localparam LLSB = LMSB-LEFT+1;
localparam RMSB = LLSB-1;
localparam RLSB = LLSB-RIGHT;
localparam integer LMSB = WIDTH-1;
localparam integer LLSB = LMSB-LEFT+1;
localparam integer RMSB = LLSB-1;
localparam integer RLSB = LLSB-RIGHT;


`ifndef RV_PHYSICAL
Expand Down Expand Up @@ -748,7 +748,7 @@ module rvecc_decode_64 (

endmodule // rvecc_decode_64


`ifndef TECH_SPECIFIC_EC_RV_ICG
module `TEC_RV_ICG
(
input logic SE, EN, CK,
Expand All @@ -773,6 +773,7 @@ module `TEC_RV_ICG
assign Q = CK & en_ff;

endmodule
`endif

`ifndef RV_FPGA_OPTIMIZE
module rvclkhdr
Expand All @@ -786,7 +787,11 @@ module rvclkhdr
logic SE;
assign SE = 0;

`ifdef TECH_SPECIFIC_EC_RV_ICG
`USER_EC_RV_ICG clkhdr ( .*, .EN(en), .CK(clk), .Q(l1clk));
`else
`TEC_RV_ICG clkhdr ( .*, .EN(en), .CK(clk), .Q(l1clk));
`endif

endmodule // rvclkhdr
`endif
Expand All @@ -805,7 +810,11 @@ module rvoclkhdr
`ifdef RV_FPGA_OPTIMIZE
assign l1clk = clk;
`else
`TEC_RV_ICG clkhdr ( .*, .EN(en), .CK(clk), .Q(l1clk));
`ifdef TECH_SPECIFIC_EC_RV_ICG
`USER_EC_RV_ICG clkhdr ( .*, .EN(en), .CK(clk), .Q(l1clk));
`else
`TEC_RV_ICG clkhdr ( .*, .EN(en), .CK(clk), .Q(l1clk));
`endif
`endif

endmodule
Expand Down
2 changes: 1 addition & 1 deletion src/riscv_core/veer_el2/tb/dasm.svi
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ string mn;
imm = opcode[24:20];
case(opcode[14:12])
1: mn = "slli";
5: mn = opcode[30] ? "srli": "srai";
5: mn = opcode[30] ? "srai": "srli";
endcase

return $sformatf("%s %s,%s,%0d", mn, abi_reg[opcode[11:7]], abi_reg[opcode[19:15]], imm);
Expand Down

0 comments on commit 786d57c

Please sign in to comment.