Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VexRiscv CPU; Use system structure similar to iob_soc_opencryptolinux. #945

Merged
merged 12 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,6 @@ jobs:
- name: run LIB test
run: nix-shell --run "make -C lib sim-test"

cache:
runs-on: self-hosted
timeout-minutes: 20
if: ${{ !cancelled() }}
needs: [ cyclonev ]

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Clean untracked files and directories (like old submodules)
run: git clean -ffdx
- name: run simulation test
run: make -C submodules/CACHE sim-test
- name: run fpga test
run: make -C submodules/CACHE fpga-test
doc:
runs-on: self-hosted
timeout-minutes: 60
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "submodules/CACHE"]
path = submodules/CACHE
url = [email protected]:IObundle/iob-cache.git
[submodule "submodules/VEXRISCV"]
path = submodules/VEXRISCV
url = [email protected]:IObundle/iob-vexriscv.git
4 changes: 2 additions & 2 deletions document/tsrc/presentation.tex
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@
\begin{lstlisting}
#include "system.h"
#include "periphs.h"
#include "iob-uart.h"
#include "iob_uart.h"
#include "printf.h"

#include "iob-timer.h"
#include "iob_timer.h"

int main()
{
Expand Down
4 changes: 2 additions & 2 deletions hardware/fpga/fpga_build.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include auto_fpga_build.mk

# Add iob-soc software as a build dependency
RUN_DEPS+=iob_soc_preboot.hex iob_soc_boot.hex iob_soc_firmware.hex
RUN_DEPS+=iob_soc_bootrom.hex iob_soc_firmware.hex
# Don't add firmware to BUILD_DEPS if we are not initializing memory since we don't want to rebuild the bitstream when we modify it.
BUILD_DEPS+=iob_soc_preboot.hex iob_soc_boot.hex $(if $(filter $(INIT_MEM),1),iob_soc_firmware.hex)
BUILD_DEPS+=iob_soc_bootrom.hex $(if $(filter $(INIT_MEM),1),iob_soc_firmware.hex)

QUARTUS_SEED ?=5

Expand Down
8 changes: 4 additions & 4 deletions hardware/fpga/quartus/cyclonev_gt_dk/board.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ if {$IS_FPGA == "1"} {
#set_location_assignment PIN_AM23 -to led
#set_instance_assignment -name IO_STANDARD "2.5-V" -to led

set_location_assignment PIN_AE25 -to trap_o
set_instance_assignment -name IO_STANDARD "1.5-V" -to trap_o
#set_location_assignment PIN_AE25 -to trap_o
#set_instance_assignment -name IO_STANDARD "1.5-V" -to trap_o

set_instance_assignment -name SLEW_RATE 1 -to trap_o
set_instance_assignment -name CURRENT_STRENGTH_NEW DEFAULT -to trap_o
#set_instance_assignment -name SLEW_RATE 1 -to trap_o
#set_instance_assignment -name CURRENT_STRENGTH_NEW DEFAULT -to trap_o

#Uart
set_location_assignment PIN_F10 -to txd_o
Expand Down
9 changes: 1 addition & 8 deletions hardware/fpga/quartus/cyclonev_gt_dk/cyclonev_gt_dk.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ def setup(py_params_dict):
{"name": "resetn", "direction": "input", "width": "1"},
],
},
{
"name": "trap",
"descr": "CPU trap output",
"signals": [
{"name": "trap", "direction": "output", "width": "1"},
],
},
{
"name": "rs232",
"descr": "Serial port",
Expand Down Expand Up @@ -263,7 +256,6 @@ def setup(py_params_dict):
},
"connect": {
"clk_en_rst": "clk_en_rst",
"cpu_trap": "trap",
"rs232": "rs232_int",
"axi": "axi",
},
Expand Down Expand Up @@ -305,6 +297,7 @@ def setup(py_params_dict):
attributes_dict["blocks"] += [
{
"core_name": "axi_interconnect_wrapper",
"name": "fpga_axi_interconnect_wrapper",
"instance_name": "axi_interconnect",
"instance_description": "Interconnect instance",
"parameters": {
Expand Down
11 changes: 0 additions & 11 deletions hardware/fpga/vivado/aes_ku040_db_g/aes_ku040_db_g.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,6 @@ def setup(py_params_dict):
"type": "clk_en_rst",
},
},
{
"name": "cpu_trap",
"descr": "CPU trap",
"signals": [
{
"name": "trap",
"width": "1",
},
],
},
{
"name": "rs232_int",
"descr": "iob-soc uart interface",
Expand Down Expand Up @@ -285,7 +275,6 @@ def setup(py_params_dict):
},
"connect": {
"clk_en_rst": "clk_en_rst",
"cpu_trap": "cpu_trap",
"rs232": "rs232_int",
"axi": "axi",
},
Expand Down
1 change: 1 addition & 0 deletions hardware/fpga/vivado/vivado_premap.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,6 @@ if { $USE_EXTMEM > 0 } {
read_verilog vivado/$BOARD/clock_wizard.v
read_verilog vivado/$BOARD/iob_reset_sync.v
read_verilog vivado/$BOARD/iob_r.v
read_verilog vivado/$BOARD/axi_ram.v

}
2 changes: 1 addition & 1 deletion hardware/modules/iob_soc_mwrap/iob_soc_mwrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def setup(py_params_dict):
"name": "BOOT_HEXFILE",
"descr": "Bootloader file name",
"type": "P",
"val": '"iob_soc_boot"',
"val": '"iob_soc_bootrom"',
"min": "NA",
"max": "NA",
},
Expand Down
11 changes: 3 additions & 8 deletions hardware/modules/iob_soc_sim_wrapper/iob_soc_sim_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ def setup(py_params_dict):
"subtype": "slave",
},
},
{
"name": "trap",
"descr": "CPU trap",
"signals": [
{"name": "trap", "direction": "output", "width": "1"},
],
},
{
"name": "uart",
"descr": "Testbench uart csrs interface",
Expand Down Expand Up @@ -194,7 +187,6 @@ def setup(py_params_dict):
},
"connect": {
"clk_en_rst": "clk_en_rst",
"cpu_trap": "trap",
"rs232": "rs232",
"axi": "axi",
},
Expand All @@ -203,8 +195,10 @@ def setup(py_params_dict):
},
{
"core_name": "iob_uart",
"name": "iob_uart_iob",
"instance_name": "uart_tb",
"instance_description": "Testbench uart core",
"csr_if": "iob",
"connect": {
"clk_en_rst": "clk_en_rst",
"cbus": "uart",
Expand All @@ -213,6 +207,7 @@ def setup(py_params_dict):
},
{
"core_name": "axi_interconnect_wrapper",
"name": "sim_axi_interconnect_wrapper",
"instance_name": "axi_interconnect",
"instance_description": "Interconnect instance",
"parameters": {
Expand Down
2 changes: 1 addition & 1 deletion hardware/simulation/sim_build.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include auto_sim_build.mk

# Add iob-soc software as a build dependency
HEX+=iob_soc_preboot.hex iob_soc_boot.hex iob_soc_firmware.hex
HEX+=iob_soc_bootrom.hex iob_soc_firmware.hex

ROOT_DIR :=../..
include $(ROOT_DIR)/software/sw_build.mk
Expand Down
7 changes: 0 additions & 7 deletions hardware/simulation/src/iob_soc_tb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,6 @@ int main(int argc, char **argv, char **env) {
#endif

while (1) {
if (dut->trap_o > 0) {
printf("\nTESTBENCH: force cpu trap exit\n");
cpu_char = 4;
fwrite(&cpu_char, sizeof(char), 1, soc2cnsl_fd);
fclose(soc2cnsl_fd);
break;
}
while (!rxread_reg && !txread_reg) {
rxread_reg = (char)iob_read(IOB_UART_RXREADY_ADDR, &uart_if);
txread_reg = (char)iob_read(IOB_UART_TXREADY_ADDR, &uart_if);
Expand Down
10 changes: 0 additions & 10 deletions hardware/simulation/src/iob_soc_tb.v
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ module iob_soc_tb;
integer i = 0, n = 0;
integer error, n_byte = 0;

//cpu trap signal
wire trap;

/////////////////////////////////////////////
// TEST PROCEDURE
//
Expand Down Expand Up @@ -144,7 +141,6 @@ module iob_soc_tb;
.clk_i (clk),
.cke_i (1'b1),
.arst_i(arst),
.trap_o(trap),

`ifdef IOB_SOC_USE_ETHERNET
.ethernet_iob_valid_i (ethernet_valid),
Expand Down Expand Up @@ -180,10 +176,4 @@ module iob_soc_tb;

`include "iob_tasks.vs"

//finish simulation on trap
always @(posedge trap) begin
#10 $display("Found CPU trap condition");
$finish();
end

endmodule
Loading