Skip to content

Commit 080c54f

Browse files
committed
Merge branch 'privileged1.10' of ssh://github.com/RoaLogic/RV12 into RC/v1.3-rc2
2 parents fab210d + 346590e commit 080c54f

38 files changed

+5789
-3211
lines changed

bench/verilog/ahb3lite/testbench_top.sv

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ module testbench_top;
4242

4343
//core parameters
4444
parameter XLEN = 64;
45-
parameter PHYS_ADDR_SIZE = 32; //32bit address bus. Also sets non-cacheable range
45+
parameter PLEN = XLEN; //32bit address bus
4646
parameter PC_INIT = 'h8000_0000; //Start here after reset
4747
parameter BASE = PC_INIT; //offset where to load program in memory
4848
parameter INIT_FILE = "test.hex";
4949
parameter MEM_LATENCY = 1;
50-
parameter WRITEBUFFER_SIZE = 8;
50+
parameter WRITEBUFFER_SIZE = 4;
5151
parameter HAS_U = 1;
5252
parameter HAS_S = 1;
5353
parameter HAS_H = 0;
@@ -81,66 +81,66 @@ localparam MULLAT = MULT_LATENCY > 4 ? 4 : MULT_LATENCY;
8181
//
8282
// Variables
8383
//
84-
logic HCLK, HRESETn;
84+
logic HCLK, HRESETn;
8585

8686
//Instruction interface
87-
logic ins_HSEL;
88-
logic [PHYS_ADDR_SIZE-1:0] ins_HADDR;
89-
logic [XLEN -1:0] ins_HRDATA;
90-
logic [XLEN -1:0] ins_HWDATA; //always 0
91-
logic ins_HWRITE; //always 0
92-
logic [ 2:0] ins_HSIZE;
93-
logic [ 2:0] ins_HBURST;
94-
logic [ 3:0] ins_HPROT;
95-
logic [ 1:0] ins_HTRANS;
96-
logic ins_HMASTLOCK;
97-
logic ins_HREADY;
98-
logic ins_HRESP;
87+
logic ins_HSEL;
88+
logic [PLEN-1:0] ins_HADDR;
89+
logic [XLEN-1:0] ins_HRDATA;
90+
logic [XLEN-1:0] ins_HWDATA; //always 0
91+
logic ins_HWRITE; //always 0
92+
logic [ 2:0] ins_HSIZE;
93+
logic [ 2:0] ins_HBURST;
94+
logic [ 3:0] ins_HPROT;
95+
logic [ 1:0] ins_HTRANS;
96+
logic ins_HMASTLOCK;
97+
logic ins_HREADY;
98+
logic ins_HRESP;
9999

100100
//Data interface
101-
logic dat_HSEL;
102-
logic [PHYS_ADDR_SIZE-1:0] dat_HADDR;
103-
logic [XLEN -1:0] dat_HWDATA;
104-
logic [XLEN -1:0] dat_HRDATA;
105-
logic dat_HWRITE;
106-
logic [ 2:0] dat_HSIZE;
107-
logic [ 2:0] dat_HBURST;
108-
logic [ 3:0] dat_HPROT;
109-
logic [ 1:0] dat_HTRANS;
110-
logic dat_HMASTLOCK;
111-
logic dat_HREADY;
112-
logic dat_HRESP;
101+
logic dat_HSEL;
102+
logic [PLEN-1:0] dat_HADDR;
103+
logic [XLEN-1:0] dat_HWDATA;
104+
logic [XLEN-1:0] dat_HRDATA;
105+
logic dat_HWRITE;
106+
logic [ 2:0] dat_HSIZE;
107+
logic [ 2:0] dat_HBURST;
108+
logic [ 3:0] dat_HPROT;
109+
logic [ 1:0] dat_HTRANS;
110+
logic dat_HMASTLOCK;
111+
logic dat_HREADY;
112+
logic dat_HRESP;
113113

114114
//Debug Interface
115-
logic dbp_bp,
116-
dbg_stall,
117-
dbg_strb,
118-
dbg_ack,
119-
dbg_we;
120-
logic [ 15:0] dbg_addr;
121-
logic [XLEN -1:0] dbg_dati,
122-
dbg_dato;
115+
logic dbp_bp,
116+
dbg_stall,
117+
dbg_strb,
118+
dbg_ack,
119+
dbg_we;
120+
logic [ 15:0] dbg_addr;
121+
logic [XLEN-1:0] dbg_dati,
122+
dbg_dato;
123123

124124

125125

126126
//Host Interface
127-
logic host_csr_req,
128-
host_csr_ack,
129-
host_csr_we;
130-
logic [XLEN -1:0] host_csr_tohost,
131-
host_csr_fromhost;
127+
logic host_csr_req,
128+
host_csr_ack,
129+
host_csr_we;
130+
logic [XLEN-1:0] host_csr_tohost,
131+
host_csr_fromhost;
132132

133133

134134
//Unified memory interface
135-
logic [ 1:0] mem_htrans[2];
136-
logic [ 3:0] mem_hburst[2];
137-
logic mem_hready[2],
138-
mem_hresp[2];
139-
logic [PHYS_ADDR_SIZE-1:0] mem_haddr[2];
140-
logic [XLEN -1:0] mem_hwdata[2],
141-
mem_hrdata[2];
142-
logic [ 2:0] mem_hsize[2];
143-
logic mem_hwrite[2];
135+
logic [ 1:0] mem_htrans[2];
136+
logic [ 3:0] mem_hburst[2];
137+
logic mem_hready[2],
138+
mem_hresp[2];
139+
logic [PLEN-1:0] mem_haddr[2];
140+
logic [XLEN-1:0] mem_hwdata[2],
141+
mem_hrdata[2];
142+
logic [ 2:0] mem_hsize[2];
143+
logic mem_hwrite[2];
144144

145145

146146
////////////////////////////////////////////////////////////////
@@ -152,7 +152,7 @@ logic mem_hwrite[2];
152152

153153
riscv_top_ahb3lite #(
154154
.XLEN ( XLEN ),
155-
.PHYS_ADDR_SIZE ( PHYS_ADDR_SIZE ), //31bit address bus
155+
.PLEN ( PLEN ), //31bit address bus
156156
.PC_INIT ( PC_INIT ),
157157
.HAS_USER ( HAS_U ),
158158
.HAS_SUPER ( HAS_S ),
@@ -221,11 +221,11 @@ assign dat_HRESP = mem_hresp[1];
221221

222222
//hookup memory model
223223
memory_model_ahb3lite #(
224-
.DATA_WIDTH ( XLEN ),
225-
.ADDR_WIDTH ( PHYS_ADDR_SIZE ),
226-
.BASE ( BASE ),
227-
.PORTS ( 2 ),
228-
.LATENCY ( MEM_LATENCY ) )
224+
.DATA_WIDTH ( XLEN ),
225+
.ADDR_WIDTH ( PLEN ),
226+
.BASE ( BASE ),
227+
.PORTS ( 2 ),
228+
.LATENCY ( MEM_LATENCY ) )
229229
unified_memory (
230230
.HRESETn ( HRESETn ),
231231
.HCLK ( HCLK ),
@@ -258,7 +258,7 @@ generate
258258
else
259259
begin
260260
//New MMIO interface
261-
mmio_if #(XLEN, PHYS_ADDR_SIZE, TOHOST, UART_TX)
261+
mmio_if #(XLEN, PLEN, TOHOST, UART_TX)
262262
mmio_if_inst (
263263
.HRESETn ( HRESETn ),
264264
.HCLK ( HCLK ),

0 commit comments

Comments
 (0)