Skip to content
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
19 changes: 9 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ PY_PARAMS:=$(shell echo $(PY_PARAMS) | cut -c2-)
endif # ifndef PY_PARAMS

BUILD_DIR ?= $(shell nix-shell --run "py2hwsw $(CORE) print_build_dir --py_params '$(PY_PARAMS)'")
NAME ?= $(shell nix-shell --run "py2hwsw $(CORE) print_core_name --py_params '$(PY_PARAMS)'")
GENERATED_NAME=$(shell nix-shell --run "py2hwsw $(CORE) print_core --py_params '$(PY_PARAMS)'")
VERSION ?= $(shell nix-shell --run "py2hwsw $(CORE) print_core_version --py_params '$(PY_PARAMS)'")
CORE_NAME=$(shell nix-shell --run "py2hwsw $(CORE) print_core_name --py_params '$(PY_PARAMS)'")

DOC ?= ug

Expand Down Expand Up @@ -69,7 +68,7 @@ lint-test:
make lint BE_IF=AXI4

fpga-build: clean setup
nix-shell --run "make -C $(BUILD_DIR) fpga-build FPGA_TOP=$(NAME) BOARD=$(BOARD)"
nix-shell --run "make -C $(BUILD_DIR) fpga-build FPGA_TOP=$(GENERATED_NAME) BOARD=$(BOARD)"

fpga-test:
make fpga-build BE_IF=IOb
Expand Down Expand Up @@ -169,28 +168,28 @@ fusesoc-update-fs-repo: fusesoc-export

# Generate standalone FuseSoC .core file that references pre-built sources from a remote source using 'provider' section.
fusesoc-core-file: fusesoc-update-fs-repo # fusesoc-export
cp fusesoc_exports/$(CORE_NAME).core .
cp fusesoc_exports/$(GENERATED_NAME).core .
# Append provider remote url to .core file
printf "\n%s\n" "$$MULTILINE_TEXT" >> $(CORE_NAME).core
echo "Generated independent $(CORE_NAME).core file (with 'provider' section)."
printf "\n%s\n" "$$MULTILINE_TEXT" >> $(GENERATED_NAME).core
echo "Generated independent $(GENERATED_NAME).core file (with 'provider' section)."

.PHONY: fusesoc-core-file

fusesoc-sign: fusesoc-core-file
mkdir -p fusesoc_sign/lib
cp $(CORE_NAME).core fusesoc_sign/lib
cp $(GENERATED_NAME).core fusesoc_sign/lib
nix-shell --run "cd fusesoc_sign;\
fusesoc library add lib;\
fusesoc core sign $(CORE_NAME) ~/.ssh/iob-fusesoc-sign-key\
fusesoc core sign $(GENERATED_NAME) ~/.ssh/iob-fusesoc-sign-key\
"

.PHONY: fusesoc-sign

# Cores published must have a 'description' with less than 256 characters, otherwise it fails to publish to cores.fusesoc.net
fusesoc-publish: fusesoc-sign
nix-shell --run "cd fusesoc_sign;\
fusesoc core show $(CORE_NAME);\
fusesoc-publish $(CORE_NAME) https://cores.fusesoc.net/\
fusesoc core show $(GENERATED_NAME);\
fusesoc-publish $(GENERATED_NAME) https://cores.fusesoc.net/\
"

.PHONY: fusesoc-publish
Expand Down
4 changes: 2 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/25.05.tar.gz") {} }:

let
py2hwsw_commit = "6f89493ce14029c1b5a35a14037e1e9780b7a75b"; # Replace with the desired commit.
py2hwsw_sha256 = "o/tU0Vogv7bwSST4crhqm9rxEXuHXvASnhChG7NZoSk="; # Replace with the actual SHA256 hash.
py2hwsw_commit = "7fdbc6d8ee83e8d43470f7d39df21de824dadd94"; # Replace with the desired commit.
py2hwsw_sha256 = "vQBJF1ZqvD3SguF1RNBYgKbPSQZ1xDKjOk0mP9Hg8yU="; # Replace with the actual SHA256 hash.
# Get local py2hwsw root from `PY2HWSW_ROOT` env variable
py2hwswRoot = builtins.getEnv "PY2HWSW_ROOT";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def setup(py_params: dict):
#
attributes_dict["subblocks"] = [
{
"core_name": "iob_reg",
"core": "iob_reg",
"instance_name": "iob_reg_care_inst",
"port_params": {
"clk_en_rst_s": "c_a_r_e",
Expand Down
8 changes: 4 additions & 4 deletions hardware/modules/iob_cache_memory/iob_cache_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,20 +237,20 @@ def setup(py_params: dict):
#
attributes_dict["subblocks"] = [
{
"core_name": "iob_ram_t2p",
"core": "iob_ram_t2p",
"instance_name": "iob_ram_t2p_inst",
},
{
"core_name": "iob_fifo_sync",
"core": "iob_fifo_sync",
"instance_name": "iob_fifo_sync_inst",
},
{
"core_name": "iob_ram_sp",
"core": "iob_ram_sp",
"instance_name": "iob_ram_sp_inst",
},
# For iob_cache_replacement_policy.v
{
"core_name": "iob_regarray_sp",
"core": "iob_regarray_sp",
"instance_name": "iob_regarray_sp_inst",
},
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def setup(py_params_dict):
converter_connect["clk_en_rst_s"] = "clk_en_rst_s"
attributes_dict["subblocks"] = [
{
"core_name": "iob_cache",
"core": "iob_cache",
"instance_name": "cache",
"instance_description": f"Unit Under Test (UUT) Cache instance with '{params['be_if']}' back end interface.",
"parameters": {
Expand All @@ -173,7 +173,7 @@ def setup(py_params_dict):
},
},
{
"core_name": "iob_universal_converter",
"core": "iob_universal_converter",
"instance_name": "iob_universal_converter",
"instance_description": "Convert IOb port from testbench into correct interface for Cache front-end bus",
"subordinate_if": "iob",
Expand All @@ -188,7 +188,7 @@ def setup(py_params_dict):
if params["be_if"] == "axi":
attributes_dict["subblocks"] += [
{
"core_name": "iob_axi_ram",
"core": "iob_axi_ram",
"instance_name": "ddr_model_mem",
"instance_description": "External memory",
"parameters": {
Expand All @@ -211,7 +211,7 @@ def setup(py_params_dict):
},
},
{
"core_name": "iob_ram_t2p_be",
"core": "iob_ram_t2p_be",
"instance_name": "iob_ram_t2p_be_inst",
"parameters": {
"ADDR_W": "AXI_ADDR_W - 2",
Expand All @@ -225,7 +225,7 @@ def setup(py_params_dict):
elif params["be_if"] == "iob":
attributes_dict["subblocks"] += [
{
"core_name": "iob_ram_sp_be",
"core": "iob_ram_sp_be",
"instance_name": "native_ram",
"parameters": {
"ADDR_W": "BE_ADDR_W",
Expand Down
22 changes: 11 additions & 11 deletions iob_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def setup(py_params: dict):
converter_connect["clk_en_rst_s"] = "clk_en_rst_s"
attributes_dict["subblocks"] = [
{
"core_name": "iob_universal_converter",
"core": "iob_universal_converter",
"instance_name": "iob_universal_converter",
"instance_description": "Convert front-end interface into internal IOb port",
"subordinate_if": FE_IF.lower(),
Expand All @@ -580,7 +580,7 @@ def setup(py_params: dict):
attributes_dict["subblocks"][-1]["parameters"]["AXI_ID_W"] = "AXI_ID_W"
attributes_dict["subblocks"] += [
{
"core_name": "iob_cache_front_end",
"core": "iob_cache_front_end",
"instance_name": "front_end",
"instance_description": "This IOb interface is connected to a processor or any other processing element that needs a cache buffer to improve the performance of accessing a slower but larger memory",
"parameters": {
Expand All @@ -597,7 +597,7 @@ def setup(py_params: dict):
},
},
{
"core_name": "iob_cache_memory",
"core": "iob_cache_memory",
"instance_name": "cache_memory",
"instance_description": "This block contains the tag, data storage memories and the Write Through Buffer if the correspeonding write policy is selected; these memories are implemented either with RAM if large enough, or with registers if small enough",
"config_macros": config_macros,
Expand Down Expand Up @@ -626,7 +626,7 @@ def setup(py_params: dict):
if BE_IF == "AXI4":
attributes_dict["subblocks"] += [
{
"core_name": "iob_cache_back_end_axi",
"core": "iob_cache_back_end_axi",
"instance_name": "back_end_axi",
"instance_description": "Memory-side interface: if the cache is at the last level before the target memory module, the back-end interface connects to the target memory (e.g. DDR) controller; if the cache is not at the last level, the back-end interface connects to the next-level cache. This module implements an AXI4 interface",
"parameters": {
Expand All @@ -653,7 +653,7 @@ def setup(py_params: dict):
elif BE_IF == "IOb":
attributes_dict["subblocks"] += [
{
"core_name": "iob_cache_back_end_iob",
"core": "iob_cache_back_end_iob",
"instance_name": "back_end_iob",
"instance_description": "Memory-side interface: if the cache is at the last level before the target memory module, the back-end interface connects to the target memory (e.g. DDR) controller; if the cache is not at the last level, the back-end interface connects to the next-level cache. This module implements an IOb interface",
"parameters": {
Expand All @@ -674,14 +674,14 @@ def setup(py_params: dict):
]
attributes_dict["subblocks"] += [
{
"core_name": "iob_cache_control",
"core": "iob_cache_control",
"instance_name": "cache_control",
"be_if": be_if,
"instantiate": False, # Instantiated manually in the verilog snippet
},
# Generate CSRs but don't instantiate it (generated hardware unused; only for software and docs)
{
"core_name": "iob_csrs",
"core": "iob_csrs",
"instance_name": "csrs",
"name": f"iob_cache_{be_if}_csrs",
"instantiate": False,
Expand Down Expand Up @@ -799,7 +799,7 @@ def setup(py_params: dict):
},
# For simulation
{
"core_name": "iob_tasks",
"core": "iob_tasks",
"instance_name": "iob_tasks_inst",
"dest_dir": "hardware/simulation/src",
"instantiate": False,
Expand All @@ -811,7 +811,7 @@ def setup(py_params: dict):
attributes_dict["superblocks"] = [
# Simulation wrapper
{
"core_name": "iob_cache_sim_wrapper",
"core": "iob_cache_sim_wrapper",
"dest_dir": "hardware/simulation/src",
"cache_confs": [
conf for conf in attributes_dict["confs"] if conf["type"] in ["P", "D"]
Expand All @@ -825,11 +825,11 @@ def setup(py_params: dict):
#
attributes_dict["sw_modules"] = [
{
"core_name": "iob_coverage_analyze",
"core": "iob_coverage_analyze",
"instance_name": "iob_coverage_analyze_inst",
},
{
"core_name": "iob_linux_device_drivers",
"core": "iob_linux_device_drivers",
},
]
#
Expand Down
Loading