mirror of
https://github.com/lowRISC/ibex.git
synced 2025-06-28 01:12:02 -04:00
Add Synopsys VCS Support for Ibex Simple System
Add VCS to core description. Add stimuli. Fix compile error for assigmnet from multiple blocks.
This commit is contained in:
parent
9c981b198e
commit
cead186836
4 changed files with 47 additions and 7 deletions
|
@ -92,6 +92,26 @@ The simulator produces several output files
|
||||||
* ibex_simple_system_pcount.csv - A csv of the performance counters
|
* ibex_simple_system_pcount.csv - A csv of the performance counters
|
||||||
* trace_core_00000000.log - An instruction trace of execution
|
* trace_core_00000000.log - An instruction trace of execution
|
||||||
|
|
||||||
|
## Simulating with Synopsys VCS
|
||||||
|
|
||||||
|
Similar to the Verilator flow the Simple System simulator binary can be built using:
|
||||||
|
|
||||||
|
```
|
||||||
|
fusesoc --cores-root=. run --target=sim --tool=vcs --setup --build lowrisc:ibex:ibex_simple_system --RV32M=1 --RV32E=0 --SRAM_INIT_FILE=`<sw_vmem_file>`
|
||||||
|
```
|
||||||
|
|
||||||
|
`<sw_vmem_file>` should be a path to a vmem file built as described above, use
|
||||||
|
./examples/sw/simple_system/hello_test/hello_test.vmem to run the hello_test
|
||||||
|
binary.
|
||||||
|
|
||||||
|
To run the simulator:
|
||||||
|
|
||||||
|
```
|
||||||
|
./build/lowrisc_ibex_ibex_simple_system_0/sim-vcs/lowrisc_ibex_ibex_simple_system_0
|
||||||
|
```
|
||||||
|
|
||||||
|
Pass `-gui` to use the DVE GUI.
|
||||||
|
|
||||||
## System Memory Map
|
## System Memory Map
|
||||||
|
|
||||||
| Address | Description |
|
| Address | Description |
|
||||||
|
|
|
@ -27,6 +27,10 @@ parameters:
|
||||||
paramtype: vlogparam
|
paramtype: vlogparam
|
||||||
default: 0
|
default: 0
|
||||||
description: Enable the E ISA extension (reduced register set) [0/1]
|
description: Enable the E ISA extension (reduced register set) [0/1]
|
||||||
|
SRAM_INIT_FILE:
|
||||||
|
datatype: str
|
||||||
|
paramtype: vlogdefine
|
||||||
|
descriptions: Path to a vmem file to initialize the RAM with
|
||||||
|
|
||||||
targets:
|
targets:
|
||||||
sim:
|
sim:
|
||||||
|
@ -36,8 +40,12 @@ targets:
|
||||||
parameters:
|
parameters:
|
||||||
- RV32M
|
- RV32M
|
||||||
- RV32E
|
- RV32E
|
||||||
|
- SRAM_INIT_FILE
|
||||||
toplevel: ibex_simple_system
|
toplevel: ibex_simple_system
|
||||||
tools:
|
tools:
|
||||||
|
vcs:
|
||||||
|
vcs_options:
|
||||||
|
- '-debug_access+r'
|
||||||
verilator:
|
verilator:
|
||||||
mode: cc
|
mode: cc
|
||||||
verilator_options:
|
verilator_options:
|
||||||
|
|
|
@ -21,10 +21,7 @@ module ibex_simple_system (
|
||||||
parameter bit RV32E = 0;
|
parameter bit RV32E = 0;
|
||||||
parameter bit RV32M = 1;
|
parameter bit RV32M = 1;
|
||||||
|
|
||||||
logic clk_sys, rst_sys_n;
|
logic clk_sys = 1'b0, rst_sys_n;
|
||||||
|
|
||||||
assign clk_sys = IO_CLK;
|
|
||||||
assign rst_sys_n = IO_RST_N;
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
CoreD,
|
CoreD,
|
||||||
|
@ -69,6 +66,22 @@ module ibex_simple_system (
|
||||||
assign cfg_device_addr_mask[SimCtrl] = ~32'h3FF; // 1 kB
|
assign cfg_device_addr_mask[SimCtrl] = ~32'h3FF; // 1 kB
|
||||||
|
|
||||||
|
|
||||||
|
`ifdef VERILATOR
|
||||||
|
assign clk_sys = IO_CLK;
|
||||||
|
assign rst_sys_n = IO_RST_N;
|
||||||
|
`else
|
||||||
|
initial begin
|
||||||
|
rst_sys_n = 1'b0;
|
||||||
|
device_err = '{default:1'b0};
|
||||||
|
#8
|
||||||
|
rst_sys_n = 1'b1;
|
||||||
|
end
|
||||||
|
always begin
|
||||||
|
#1 clk_sys = 1'b0;
|
||||||
|
#1 clk_sys = 1'b1;
|
||||||
|
end
|
||||||
|
`endif
|
||||||
|
|
||||||
bus #(
|
bus #(
|
||||||
.NrDevices (NrDevices),
|
.NrDevices (NrDevices),
|
||||||
.NrHosts (NrHosts ),
|
.NrHosts (NrHosts ),
|
||||||
|
|
|
@ -36,7 +36,7 @@ module simulator_ctrl #(
|
||||||
localparam SIM_CTRL_ADDR = 1;
|
localparam SIM_CTRL_ADDR = 1;
|
||||||
|
|
||||||
logic [7:0] ctrl_addr;
|
logic [7:0] ctrl_addr;
|
||||||
logic [2:0] sim_finish;
|
logic [2:0] sim_finish = 3'b000;
|
||||||
|
|
||||||
integer log_fd;
|
integer log_fd;
|
||||||
|
|
||||||
|
@ -78,9 +78,7 @@ module simulator_ctrl #(
|
||||||
endcase
|
endcase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
always_ff @(posedge clk_i or negedge rst_ni) begin
|
|
||||||
if (sim_finish != 'b0) begin
|
if (sim_finish != 'b0) begin
|
||||||
sim_finish <= sim_finish + 1;
|
sim_finish <= sim_finish + 1;
|
||||||
end
|
end
|
||||||
|
@ -88,6 +86,7 @@ module simulator_ctrl #(
|
||||||
$finish;
|
$finish;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
assign rdata_o = '0;
|
assign rdata_o = '0;
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue