Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoConti committed Jan 21, 2025
1 parent 939ecd2 commit 30ef384
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
# limitations under the License.
#
# Author: Manuel Eggimann

BENDER ?= $(PULPISSIMO_UTILS)/bender
# Check if bender is in PATH; if yes, use it; if not, use $(PULPISSIMO_UTILS)/bender
ifeq (, $(shell which bender 2>/dev/null))
BENDER ?= $(PULPISSIMO_UTILS)/bender
else
BENDER ?= bender
endif
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
PULPISSIMO_ROOT=$(abspath $(current_dir)/..)
Expand Down
14 changes: 10 additions & 4 deletions target/sim/tb/tb_pulp.sv
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module tb_pulp;
localparam IO_PAD_CAM_VSYNC = 19;
// I2C
localparam IO_PAD_I2C0_SDA = 20;
localparam IO_PAD_12C0_SCL = 21;
localparam IO_PAD_I2C0_SCL = 21;
// GPIO
localparam IO_PAD_SDIO_DATA0 = 22;
// I2S
Expand Down Expand Up @@ -286,13 +286,19 @@ module tb_pulp;
endgenerate
`endif

`ifndef VERILATOR
wire w_pad_i2c0_sda;
wire w_pad_i2c0_scl;

alias w_pad_i2c0_scl = w_pad_io[IO_PAD_I2C0_SCL];
alias w_pad_i2c0_sda = w_pad_io[IO_PAD_I2C0_SDA];

pullup sda0_pullup_i (w_pad_i2c0_scl);
pullup scl0_pullup_i (w_pad_i2c0_sda);
`else
pullup sda0_pullup_i (w_pad_io[IO_PAD_I2C0_SDA]);
pullup scl0_pullup_i (w_pad_io[IO_PAD_I2C0_SCL]);

pullup sda1_pullup_i (w_pad_io[IO_PAD_I2C1_SDA]);
pullup scl1_pullup_i (w_pad_io[IO_PAD_I2C1_SCL]);
`endif

always_comb begin
sim_jtag_enable = 1'b0;
Expand Down
6 changes: 2 additions & 4 deletions target/sim/verilator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ $(VERILATOR_BUILD_DIR)/pulpissimo.f: Bender.lock Bender.yml $(VERILATOR_BUILD_DI
$(BENDER) script verilator -t tech_cells_generic_include_deprecated -t rtl -t verilator -t rtl_sim -t verilator_dpi -DSYNTHESIS -DVERILATOR > $@
echo $(VERILATOR_DPI) >> $@

.PHONY: clean-verilator-bender
clean-verilator-bender:
rm -rf $(VERILATOR_BUILD_DIR)/pulpissimo.f

Expand All @@ -65,12 +66,9 @@ $(VERILATOR_BUILD_DIR)/obj_dir/Vtb_pulp: $(VERILATOR_BUILD_DIR)/pulpissimo.f
cd $(VERILATOR_BUILD_DIR); $(VERILATOR) $(VERILATOR_ARGS) -CFLAGS "-O2" --top tb_pulp -f $(VERILATOR_BUILD_DIR)/pulpissimo.f

.PHONY: verilate
verilate: $(VERILATOR_BUILD_DIR)/obj_dir/Vtb_pulp
verilate: clean-verilator-bender verilator-bender $(VERILATOR_BUILD_DIR)/obj_dir/Vtb_pulp

clean-verilate:
rm -rf $(VERILATOR_BUILD_DIR)/obj_dir

verilator: verilator/obj_dir/Vtb_croc_soc
cd verilator; obj_dir/Vtb_croc_soc +binary="$(realpath $(SW_HEX))"

.PHONY: verilator

0 comments on commit 30ef384

Please sign in to comment.