Skip to content
Open
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
3 changes: 2 additions & 1 deletion Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: 1.22.1 }
tech_cells_generic: { git: "https://github.com/pulp-platform/tech_cells_generic.git", version: 0.2.6 }
jtag_pulp: { git: "https://github.com/pulp-platform/jtag_pulp.git", rev: "v0.1" }
pulp_soc: { git: "https://github.com/pulp-platform/pulp_soc.git", version: 3.0.0 }
pulp_soc: { git: "https://github.com/pulp-platform/pulp_soc.git", rev: "v3.0.0" }
pulp_cluster: { git: "https://github.com/pulp-platform/pulp_cluster.git", rev: "e71ff80ab1e661a1ba4df78eceae42caeec074ad" }
tbtools: { git: "https://github.com/pulp-platform/tbtools.git", version: 0.2.1 }

Expand All @@ -31,6 +31,7 @@ sources:
- rtl/vip/spi_master_padframe.sv
- rtl/vip/uart_tb_rx.sv
- rtl/vip/camera/cam_vip.sv
- rtl/vip/sdio/sdModel.v

# S25FS256_model (SPI Flash)
- target: all(any(test,simulation), flash_vip)
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ scripts-bender-vsim-vips: | Bender.lock
echo 'set ROOT [file normalize [file dirname [info script]]/..]' > $(BENDER_SIM_BUILD_DIR)/compile.tcl
./bender script vsim \
--vlog-arg="$(VLOG_ARGS)" --vcom-arg="" \
-t rtl -t test -t rt_dpi -t i2c_vip -t flash_vip -t i2s_vip -t hyper_vip -t use_vips \
-t rtl -t test -t rt_dpi -t i2c_vip -t flash_vip -t i2s_vip -t sdio_vip -t hyper_vip -t use_vips \
| grep -v "set ROOT" >> $(BENDER_SIM_BUILD_DIR)/compile.tcl

scripts-bender-vsim-psram: | Bender.lock
Expand All @@ -104,7 +104,7 @@ scripts-vips:
ifndef IPAPPROX
$(MAKE) scripts-bender-vsim-vips
else
./generate-scripts --rt-dpi --i2c-vip --flash-vip --i2s-vip --hyper-vip --use-vip --verbose
./generate-scripts --rt-dpi --i2c-vip --flash-vip --i2s-vip --sdio-vip --hyper-vip --use-vip --verbose
endif

scripts-psram:
Expand Down
6 changes: 6 additions & 0 deletions generate-scripts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ parser.add_argument('--flash-vip', action='store_true',
parser.add_argument('--i2s-vip', action='store_true',
help="""Use the i2s model (24FC1025).
Needs to be installed.""")
parser.add_argument('--sdio-vip', action='store_true',
help="""Use sdio sdModel.
Needs to be installed.""")
parser.add_argument('--hyper-vip', action='store_true',
help="""Use the hyperbus models (S27KS0641 and S26KS512S).
Needs to be installed.""")
Expand Down Expand Up @@ -86,6 +89,9 @@ if not args.psram_vip:
if not args.i2s_vip:
del (ipdb.rtl_dic['vip'].sub_ips['i2s_model'])

if not args.sdio_vip:
del (ipdb.rtl_dic['vip'].sub_ips['sdio_model'])

# generate ModelSim/QuestaSim compilation scripts
ipdb.export_make(script_path="sim/vcompile/ips")
ipdb.export_make(script_path="sim/vcompile/rtl", source='rtl')
Expand Down
43 changes: 38 additions & 5 deletions rtl/tb/tb_pulp.sv
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,19 @@ module tb_pulp;
parameter USE_24FC1025_MODEL = 1;
parameter USE_I2S_MODEL = 1;
parameter USE_HYPER_MODELS = 1;
parameter USE_SDIO_MODEL = 1;
`elsif USE_VIPS
parameter USE_S25FS256S_MODEL = 1;
parameter USE_24FC1025_MODEL = 1;
parameter USE_I2S_MODEL = 1;
parameter USE_HYPER_MODELS = 1;
parameter USE_SDIO_MODEL = 1;
`else
parameter USE_S25FS256S_MODEL = 0;
parameter USE_24FC1025_MODEL = 0;
parameter USE_I2S_MODEL = 0;
parameter USE_HYPER_MODELS = 0;
parameter USE_SDIO_MODEL = 0;
`endif
//psram model, cannot be tested simultaneously with the hyperram
`ifdef TARGET_PSRAM_VIP
Expand Down Expand Up @@ -178,6 +181,14 @@ module tb_pulp;
tri w_spi_master_sck;

tri w_sdio_data0;
tri w_sdio_data1;
tri w_sdio_data2;
tri w_sdio_data3;

tri w_sdio_clk;
tri w_sdio_cmd;



wire w_i2c0_scl;
wire w_i2c0_sda;
Expand Down Expand Up @@ -504,6 +515,7 @@ module tb_pulp;
);
end
endgenerate

/* SPI flash model (not open-source, from Spansion) */
generate
if(USE_S25FS256S_MODEL == 1) begin
Expand Down Expand Up @@ -559,6 +571,27 @@ module tb_pulp;
);
end

/* SDIO SDCard model */
if (USE_SDIO_MODEL==1) begin

pullup cmd_pullup_i (w_sdio_cmd);
pullup data3_pullup_i (w_sdio_data3);
pullup data2_pullup_i (w_sdio_data2);
pullup data1_pullup_i (w_sdio_data1);
pullup data0_pullup_i (w_sdio_data0);

sdModel sdModelTB0(
.sdClk ( w_sdio_clk ),
.cmd ( w_sdio_cmd ),
.dat ( {
w_sdio_data3,
w_sdio_data2,
w_sdio_data1,
w_sdio_data0 }
)
);
end

if (!ENABLE_DEV_DPI && CONFIG_FILE == "NONE") begin

/* CPI verification IP */
Expand Down Expand Up @@ -718,12 +751,12 @@ module tb_pulp;
.pad_cam_data7 ( w_cam_data[7] ),
.pad_cam_vsync ( w_cam_vsync ),

.pad_sdio_clk ( ),
.pad_sdio_cmd ( ),
.pad_sdio_clk ( w_sdio_clk ),
.pad_sdio_cmd ( w_sdio_cmd ),
.pad_sdio_data0 ( w_sdio_data0 ),
.pad_sdio_data1 ( ),
.pad_sdio_data2 ( ),
.pad_sdio_data3 ( ),
.pad_sdio_data1 ( w_sdio_data1 ),
.pad_sdio_data2 ( w_sdio_data2 ),
.pad_sdio_data3 ( w_sdio_data3 ),

.pad_i2c0_sda ( w_i2c0_sda ),
.pad_i2c0_scl ( w_i2c0_scl ),
Expand Down
3 changes: 3 additions & 0 deletions rtl/vip/sdio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SDIO VIP
This IP is based on [this](https://github.com/freecores/sdcard_mass_storage_controller/blob/master/bench/sdc_dma/verilog/sdModel.v) SDIO model
We heavely modified it to test our sdio.
Loading