From f69107808bdff5e7ef7ce0b050a79d45ddc077bd Mon Sep 17 00:00:00 2001 From: Marwan Abbas <67271180+marwaneltoukhy@users.noreply.github.com> Date: Mon, 9 Feb 2026 12:32:56 +0200 Subject: [PATCH 1/4] Add conditional SPI flash instantiation Conditionally instantiate SPI flash module based on USE_SPIFLASH definition. --- verilog/rtl/toplevel_cocotb.v | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/verilog/rtl/toplevel_cocotb.v b/verilog/rtl/toplevel_cocotb.v index a56754c5..8205a127 100644 --- a/verilog/rtl/toplevel_cocotb.v +++ b/verilog/rtl/toplevel_cocotb.v @@ -173,6 +173,8 @@ caravel uut ( .resetb (resetb_tb) ); + // SPI flash is optional for OpenFrame - only instantiate if USE_SPIFLASH is defined + `ifdef USE_SPIFLASH spiflash #( .FILENAME(FILENAME) ) spiflash ( @@ -183,6 +185,8 @@ caravel uut ( .io2(mprj_io_tb[36]), .io3(mprj_io_tb[37]) ); + `endif // USE_SPIFLASH + // do anything to the unused wires so cocotb can read them when iverilog is used // apparently iverilog can't read the unused wires and that causes an error in python assign gpio_tb = 0; From cc0e79859ecd163ba2aeb002a82e54fd1ea89d70 Mon Sep 17 00:00:00 2001 From: Marwan Abbas <67271180+marwaneltoukhy@users.noreply.github.com> Date: Mon, 9 Feb 2026 12:35:51 +0200 Subject: [PATCH 2/4] Create includes.rtl.caravel for Caravel RTL Add standard Caravel RTL includes for Verilog files. --- verilog/includes/includes.rtl.caravel | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 verilog/includes/includes.rtl.caravel diff --git a/verilog/includes/includes.rtl.caravel b/verilog/includes/includes.rtl.caravel new file mode 100644 index 00000000..6858d50a --- /dev/null +++ b/verilog/includes/includes.rtl.caravel @@ -0,0 +1,13 @@ +# Standard Caravel RTL includes +# This is a placeholder - full Caravel requires MCW_ROOT + +# PDK cells +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_io/verilog/sky130_fd_io.v +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_io/verilog/sky130_ef_io.v +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_sc_hd/verilog/primitives.v +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_sc_hd/verilog/sky130_fd_sc_hd.v +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_sc_hvl/verilog/primitives.v +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_sc_hvl/verilog/sky130_fd_sc_hvl.v + +# Note: Standard Caravel includes require MCW_ROOT for the management SoC +# This file is for OpenFrame mode only From 01e9687884e47c9d74cfeaf782569ce60e515e32 Mon Sep 17 00:00:00 2001 From: Marwan Abbas <67271180+marwaneltoukhy@users.noreply.github.com> Date: Mon, 9 Feb 2026 12:36:19 +0200 Subject: [PATCH 3/4] Add includes for Caravel/OpenFrame GL netlists Added OpenFrame GL includes for Caravel/OpenFrame padframe and infrastructure. --- .../includes/includes.gl.caravel_openframe | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 verilog/includes/includes.gl.caravel_openframe diff --git a/verilog/includes/includes.gl.caravel_openframe b/verilog/includes/includes.gl.caravel_openframe new file mode 100644 index 00000000..04f83234 --- /dev/null +++ b/verilog/includes/includes.gl.caravel_openframe @@ -0,0 +1,21 @@ +# OpenFrame GL includes +# Caravel/OpenFrame padframe and infrastructure - gate level + +# PDK cells +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_io/verilog/sky130_fd_io.v +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_io/verilog/sky130_ef_io.v +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_sc_hd/verilog/primitives.v +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_sc_hd/verilog/sky130_fd_sc_hd.v +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_sc_hvl/verilog/primitives.v +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_sc_hvl/verilog/sky130_fd_sc_hvl.v + +# OpenFrame GL netlists +-v $(CARAVEL_VERILOG_PATH)/rtl/defines.v +-v $(CARAVEL_VERILOG_PATH)/rtl/user_defines.v +-v $(CARAVEL_VERILOG_PATH)/rtl/pads.v +-v $(CARAVEL_VERILOG_PATH)/gl/user_id_programming.v +-v $(CARAVEL_VERILOG_PATH)/gl/chip_io_openframe.v +-v $(CARAVEL_VERILOG_PATH)/gl/constant_block.v +-v $(CARAVEL_VERILOG_PATH)/gl/xres_buf.v +-v $(CARAVEL_VERILOG_PATH)/gl/caravel_openframe.v +-v $(CARAVEL_VERILOG_PATH)/rtl/simple_por.v From 6ff15b7ecba720fd6ad4ddbeb632b520a680a244 Mon Sep 17 00:00:00 2001 From: Marwan Abbas <67271180+marwaneltoukhy@users.noreply.github.com> Date: Mon, 9 Feb 2026 12:37:04 +0200 Subject: [PATCH 4/4] Add includes for Caravel_OpenFrame RTL Add RTL includes for Caravel_OpenFrame padframe and infrastructure. --- .../includes/includes.rtl.caravel_openframe | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 verilog/includes/includes.rtl.caravel_openframe diff --git a/verilog/includes/includes.rtl.caravel_openframe b/verilog/includes/includes.rtl.caravel_openframe new file mode 100644 index 00000000..19ed187d --- /dev/null +++ b/verilog/includes/includes.rtl.caravel_openframe @@ -0,0 +1,21 @@ +# OpenFrame RTL includes +# Caravel/OpenFrame padframe and infrastructure + +# PDK cells +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_io/verilog/sky130_fd_io.v +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_io/verilog/sky130_ef_io.v +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_sc_hd/verilog/primitives.v +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_sc_hd/verilog/sky130_fd_sc_hd.v +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_sc_hvl/verilog/primitives.v +-v $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_sc_hvl/verilog/sky130_fd_sc_hvl.v + +# OpenFrame RTL +-v $(CARAVEL_VERILOG_PATH)/rtl/defines.v +-v $(CARAVEL_VERILOG_PATH)/rtl/user_defines.v +-v $(CARAVEL_VERILOG_PATH)/rtl/pads.v +-v $(CARAVEL_VERILOG_PATH)/rtl/user_id_programming.v +-v $(CARAVEL_VERILOG_PATH)/rtl/chip_io_openframe.v +-v $(CARAVEL_VERILOG_PATH)/rtl/constant_block.v +-v $(CARAVEL_VERILOG_PATH)/rtl/xres_buf.v +-v $(CARAVEL_VERILOG_PATH)/rtl/caravel_openframe.v +-v $(CARAVEL_VERILOG_PATH)/rtl/simple_por.v