Skip to content

Commit

Permalink
Update padframe target
Browse files Browse the repository at this point in the history
  • Loading branch information
micprog committed Feb 29, 2024
1 parent 1b84d46 commit 650cc36
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 35 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ xcelium.d/
xrun.history
xrun.log
.bender
bender
/utils/bin/bender
work/
compile.tcl
working_dir/
/padrick
/utils/bin/padrick
/Bender.local
/build
22 changes: 20 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ include $(PULPISSIMO_ROOT)/utils/utils.mk
checkout: $(PULPISSIMO_UTILS)/bender
$(PULPISSIMO_UTILS)/bender checkout

.PHONY: hw
.PHONY: hw bootrom padframe
## Re-generate generated hardware IPs
hw: hw/asic_autogen_rom.sv hw/fpga_autogen_rom.sv
hw: bootrom padframe

## Generate the boot rom
bootrom: hw/asic_autogen_rom.sv hw/fpga_autogen_rom.sv

## Generate the ASIC and simulation boot rom
hw/asic_autogen_rom.sv:
Expand All @@ -44,6 +47,21 @@ hw/asic_autogen_rom.sv:
hw/fpga_autogen_rom.sv:
$(MAKE) -C sw/bootcode fpga_autogen_rom.sv
cp sw/bootcode/fpga_autogen_rom.sv $@

padframe: hw/padframe/pulpissimo_padframe_rtl_sim_autogen hw/padframe/pulpissimo_padframe_fpga_autogen

hw/padframe/pulpissimo_padframe_rtl_sim_autogen: $(PULPISSIMO_UTILS)/padrick
cd hw/padframe && $(PULPISSIMO_UTILS)/padrick generate -s padrick_generator_settings.yml rtl rtl_sim_padframe_config_top.yml -o pulpissimo_padframe_rtl_sim_autogen

hw/padframe/pulpissimo_padframe_fpga_autogen: $(PULPISSIMO_UTILS)/padrick
cd hw/padframe && $(PULPISSIMO_UTILS)/padrick generate -s padrick_generator_settings.yml rtl fpga_padframe_config_top.yml -o pulpissimo_padframe_fpga_autogen

.PHONY: gpio-reconfigure
## Reconfigure number of GPIOs
## @param GPIO=32 Number of GPIOs to reconfigure
gpio-reconfigure:
$(MAKE) -C hw/vendored_ips/gpio reconfigure

HELP_TITLE="PULPissimo Build & SIM Environment"
HELP_DESCRIPTION="Toplevel targets for building and simulating PULPissimo. Please check the make files in the subdirectories for additional targets.."
include $(PULPISSIMO_ROOT)/utils/help.mk
Expand Down
10 changes: 5 additions & 5 deletions hw/clock_gen_fpga.sv
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module clock_gen #(

// Configuration interface for clock generation
input logic cfg_clk_i,
APB.Slave cfg_bus_slave,
APB.Slave cfg_bus_slave,


// Output clocks
Expand Down Expand Up @@ -73,9 +73,9 @@ module clock_gen #(
logic s_slow_clk_ungated;

// Tie-off APB port with error response
cfg_bus_slave.pready = 1'b1;
cfg_bus_slave.prdata = 32'deadda7a;
cfg_bus_slave.pslverr = 1'b1;
assign cfg_bus_slave.pready = 1'b1;
assign cfg_bus_slave.prdata = 32'hdeadda7a;
assign cfg_bus_slave.pslverr = 1'b1;

// Instantiate LogiCore clocking mngr IP
xilinx_clk_mngr i_clk_manager (
Expand Down Expand Up @@ -127,7 +127,7 @@ module clock_gen #(

// Instantiate clock divider to divide 8.3886 MHz PLL clock down to 32 kHz
clk_int_div #(
.DIV_VALUE_WIDTH ( 9 )
.DIV_VALUE_WIDTH ( 9 ),
.DEFAULT_DIV_VALUE ( 256 ),
.ENABLE_CLOCK_IN_RESET ( 1'b1 )
) i_slow_clk_div (
Expand Down
2 changes: 1 addition & 1 deletion hw/padframe/custom_templates/rtl_templates/Bender.yml.mako
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package:
- "Padrick"

dependencies:
register_interface: { git: "https://github.com/pulp-platform/register_interface.git", version: 0.3.1 }
register_interface: { git: "https://github.com/pulp-platform/register_interface.git", version: 0.4.1 }
common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: 1.21.0 }

export_include_dirs:
Expand Down
5 changes: 2 additions & 3 deletions hw/padframe/padframe_adapter.sv
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
//-----------------------------------------------------------------------------

module padframe_adapter #(
localparam NGPIO = gpio_reg_pkg::GPIOCount // Have a look at the README in
// the GPIO repo in order to
// change the number of GPIOs.
/// Have a look at the README in the GPIO repo in order to change the number of GPIOs.
localparam int unsigned NGPIO = gpio_reg_pkg::GPIOCount
)(
input logic soc_clk_i,
input logic soc_rstn_synced_i,
Expand Down
2 changes: 1 addition & 1 deletion hw/padframe/pulpissimo_padframe_rtl_sim_autogen/Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package:
- "Padrick"

dependencies:
register_interface: { git: "https://github.com/pulp-platform/register_interface.git", version: 0.3.1 }
register_interface: { git: "https://github.com/pulp-platform/register_interface.git", version: 0.4.1 }
common_cells: { git: "https://github.com/pulp-platform/common_cells.git", version: 1.21.0 }

export_include_dirs:
Expand Down
36 changes: 17 additions & 19 deletions hw/pulpissimo.sv
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,23 @@
// -----------------------------------------------------------------------------

module pulpissimo #(
parameter CORE_TYPE = 0, // 0 for CV32E40P with XPULP Extensions, 1 for IBEX RV32IMC (formerly ZERORISCY), 2 for IBEX RV32EC (formerly MICRORISCY)
parameter USE_XPULP = 1, // Enable XPULP extensions on CV32E40P. Has no
// effect if an IBEX core variant is use.
parameter USE_FPU = 1, // Mutually exclusive with the use of IBEX. I.e.
// if an IBEX core variant is used, this paraeter
// is ignored.
parameter USE_ZFINX = 1, // Standard RISC-V extension: Reuses the integer
// regfile for FPU usage instead of requiring a
// dedicated FPU regfile. Requires correct
// compiler settings for software to work!
parameter USE_HWPE = 0,
parameter SIM_STDOUT = 0, // Enable the virtual stdout interface for
// communication with simulated testbenches. This
// parameter must be disabled during any form of
// physical implementation.
localparam IO_PAD_COUNT = gpio_reg_pkg::GPIOCount // The number of GPIO pads
// in the system. Check the
// README on how to modify
// the pad count
/// 0 for CV32E40P with XPULP Extensions, 1 for IBEX RV32IMC (formerly ZERORISCY),
/// 2 for IBEX RV32EC (formerly MICRORISCY)
parameter int unsigned CORE_TYPE = 0,
/// Enable XPULP extensions on CV32E40P. Has no effect if an IBEX core variant is use.
parameter bit USE_XPULP = 1,
/// Mutually exclusive with the use of IBEX. I.e. if an IBEX core variant is used, this parameter
/// is ignored.
parameter bit USE_FPU = 1,
/// Standard RISC-V extension: Reuses the integer regfile for FPU usage instead of requiring a
/// dedicated FPU regfile. Requires correct compiler settings for software to work!
parameter bit USE_ZFINX = 1,
parameter bit USE_HWPE = 0,
/// Enable the virtual stdout interface for communication with simulated testbenches. This
/// parameter must be disabled during any form of physical implementation.
parameter bit SIM_STDOUT = 0,
/// The number of GPIO pads in the system. Check the README on how to modify the pad count
localparam int unsigned IO_PAD_COUNT = gpio_reg_pkg::GPIOCount
)(
// Some platforms (e.g. Verilator) require to feed the clock externally. With
// the EXTERNAL_CLOCK define we remove all internall clock generation logic.
Expand Down
4 changes: 2 additions & 2 deletions utils/utils.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ include $(mkfile_dir)/venv.mk
$(PULPISSIMO_UTILS)/padrick:
ifeq (,$(widlcard bin/padrick))
mkdir -p $(PULPISSIMO_UTILS)
cd $(PULPISSIMO_UTILS) && curl https://api.github.com/repos/pulp-platform/padrick/releases/tags/v0.3.4 \
cd $(PULPISSIMO_UTILS) && curl https://api.github.com/repos/pulp-platform/padrick/releases/tags/v0.3.6 \
| grep "browser_download_url.*Padrick-x86_64.AppImage" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -
mv $(PULPISSIMO_UTILS)/Padrick-x86_64.AppImage $(PULPISSIMO_UTILS)/padrick
chmod a+x bin/padrick
chmod a+x $(PULPISSIMO_UTILS)/padrick
endif

$(PULPISSIMO_UTILS)/bender:
Expand Down

0 comments on commit 650cc36

Please sign in to comment.