Skip to content
Open

Zfh #13

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
5c9f310
Sparce isa integration (#1)
cole-nelson Oct 9, 2020
a432ac2
Changed TBs to use internal halt signal due to removal of
cole-nelson Oct 10, 2020
03979a5
Interrupt integration (#2)
Enes-Shaltami Oct 21, 2020
8a8a5bf
Bus team (#3)
cole-nelson Oct 21, 2020
47abfb4
Mul div fix (#4)
cole-nelson Oct 26, 2020
045c64e
Priv Unit Fixes (#5)
cole-nelson Mar 9, 2021
eb9a279
Add files via upload
duanh1028 Mar 10, 2021
9e2405b
Merge pull request #7 from Purdue-SoCET/risc_mgmt_extension_uvm
duanh1028 Mar 10, 2021
712b300
Add files via upload
duanh1028 Mar 10, 2021
03b81da
Compressed (#6)
jingyin77 Mar 15, 2021
f4fa7f3
add RV32E support. (#9)
jhsyu Mar 27, 2021
1e9e72a
WFI detection for clock manager (#10)
raghu1996 Apr 1, 2021
5fb659b
Verilator (#19)
cole-nelson Sep 15, 2022
d283c48
Fix for RV32C incorrect execution.
cole-nelson Oct 6, 2022
8e96b87
Privileged Unit 1.12 CSR Update (#17)
hadiahmed098 Oct 12, 2022
1a203c8
Fusesoc (#20)
cole-nelson Oct 18, 2022
9f09e77
Priv 1.12 PMA integration (#21)
hadiahmed098 Oct 31, 2022
03e4fb5
v1.12 PMP Integration (#22)
hadiahmed098 Nov 16, 2022
8682516
User Mode, v1.12 implementation (#23)
hadiahmed098 Nov 30, 2022
00e898b
tspp, standard_core: decouple rd selection from control unit
cole-nelson Nov 6, 2022
fb466da
Initial commit of 3-stage pipeline: All tests passing
cole-nelson Nov 6, 2022
f0d37cc
stage3: Add full CPU tracker support
cole-nelson Nov 6, 2022
f43b408
stage3: exceptions functional
cole-nelson Nov 6, 2022
3e4d85a
stage3: Interrupt test passing
cole-nelson Nov 6, 2022
6fe0e3f
stage3: RV32C working
cole-nelson Nov 6, 2022
19abd2c
standard_core: Add test version without memory controller
cole-nelson Nov 7, 2022
fba6137
stage3: Fix bugs resulting from back-to-back instruction execution
cole-nelson Nov 7, 2022
f141649
Bugfix: adding .core and TB file for the no_memory version of the TB
cole-nelson Nov 7, 2022
7ec493d
stage3: Fixes to allow synthesis under Quartus + Genus
cole-nelson Nov 7, 2022
e1b0327
stage3: RV32M integration
cole-nelson Nov 15, 2022
cc03b4f
Added new privileged unit changes to core
hadiahmed098 Dec 11, 2022
cdd1e69
Minor PMA fixes
hadiahmed098 Dec 14, 2022
dd65e2d
stage3: Fix fetch-after-redirect bug
cole-nelson Jan 2, 2023
22a355a
APB: Fix back-to-back transactions
cole-nelson Jan 2, 2023
7d63c0f
apb: Fix alignment
cole-nelson Jan 3, 2023
4153d13
ram_sim_model: Change to support loading binary data instead of hex
cole-nelson Jan 4, 2023
2be5971
stage3: Fix bugs preventing runs with Xcelium/Modelsim
cole-nelson Jan 4, 2023
435c231
stage3: Fix bug where MEPC gets unknown value
cole-nelson Jan 9, 2023
2c8f46c
bus_bridges: Fixup AHB bridge for AFTx07
cole-nelson Jan 9, 2023
f9c4eb9
l1 caches integration (#24)
ttlapik Apr 24, 2023
aebf325
memory_controller: Fix high-latency AHB bug
cole-nelson May 2, 2023
16549ef
CPU Tracker: Remove "display", add WFI support
cole-nelson May 2, 2023
af8ee22
Bus fault handler (#26)
cole-nelson Jun 13, 2023
2b1a48d
stage3: Fix HDL issues in Quartus
cole-nelson Jun 18, 2023
641d74d
fix: Incorrect config integer comparison form (#27)
nickelpro Aug 1, 2023
f86bd96
build: Disable verilator error for ENUMVALUE (#28)
nickelpro Aug 11, 2023
2f0807b
Zfh initial update for addition and multiplication
Sep 21, 2023
a6bdb1f
Zfh initial update for addition and multiplication
Sep 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test
on:
push:
pull_request:
branches: [main]

jobs:
ci:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3 # required
- name: Run Regression Tests
uses: Purdue-SoCET/SoCET-CI@main # core usage
with:
targets: | # List all FuseSoC Test Targets
make config
make verilate
63 changes: 63 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# ignore the build and run files
build/
sim_out/
obj_dir/
rvb_out/
# ignore memory files from test cases
*.hex
meminit.ver
verification/asm-tests/RV32I/*.elf
verification/asm-tests/RV32I/*.log
verification/asm-tests/RV32I/*.hex
*.bin
*.elf
# config files are auto-generated
source_code/include/component_selection_defines.vh
verification/c-firmware/custom_instruction_calls.h
Expand All @@ -27,3 +31,62 @@ source_code/fpga/output_files
*.lock-waf*
# Ignore files for commands for moving stuff around
*.cmd
mitll*
# Ignore temporary files created by gedit
*~
# Ignore test cache files
run_tests_cache.json
# Ignore log files and Verilator outputs
*.log
*.fst
memsim.dump
meminit.bin

# ignore files auto-generated by vscode.
_info
_vmake
*.qdb
*.qtl
*.qpg

# ignore python bytecode files
*.pyc
__pycache__/

# ignore xrun files
INCA_libs/
xcelium.d/
xrun.history
xrun.key
.simvision
waves.shm/

open_files.sh

# fusesoc
fusesoc_libraries
fusesoc.conf

# synthesis scripts
desflow1/
.vscode/

# uvm
work
mapped
fpga
transcript
*.wlf
README
*.swp
._*
*.log
*.deps
*.hex
*.ver
mti*
*.diff
system.summary
system_fpga.summary
*.vstf
*vsim*
3 changes: 3 additions & 0 deletions .rules.verible_lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parameter-name-style=localparam_style:CamelCase|ALL_CAPS
-explicit-function-lifetime
-explicit-task-lifetime
88 changes: 88 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
ROOT := $(shell pwd)

RISCV := $(ROOT)/source_code
RISCV_CORE := $(RISCV)/standard_core
PIPELINE := $(RISCV)/pipelines
RISCV_PKGS := $(RISCV)/packages
RISC_MGMT := $(RISCV)/risc_mgmt
SPARCE := $(RISCV)/sparce
PRIVS := $(RISCV)/privs
BRANCH_PREDICT := $(RISCV)/branch_predictors
CACHES := $(RISCV)/caches
RISCV_BUS := $(RISCV)/bus_bridges
RV32C := $(RISCV)/rv32c
RV32M_FILES := $(RISC_MGMT)/extensions/rv32m/carry_save_adder.sv $(RISC_MGMT)/extensions/rv32m/flex_counter_mul.sv $(RISC_MGMT)/extensions/rv32m/full_adder.sv $(RISC_MGMT)/extensions/rv32m/pp_mul32.sv $(RISC_MGMT)/extensions/rv32m/radix4_divider.sv $(RISC_MGMT)/extensions/rv32m/rv32m_decode.sv $(RISC_MGMT)/extensions/rv32m/rv32m_execute.sv $(RISC_MGMT)/extensions/rv32m/rv32m_memory.sv
RV32C_FILES := $(RV32C)/decompressor.sv $(RV32C)/fetch_buffer.sv $(RV32C)/rv32c_disabled.sv $(RV32C)/rv32c_enabled.sv $(RV32C)/rv32c_wrapper.sv
RISC_MGMT_FILES := $(RISC_MGMT)/risc_mgmt_wrapper.sv $(RISC_MGMT)/tspp/tspp_risc_mgmt.sv $(RV32M_FILES)
RISC_EXT_FILES := $(RISC_MGMT)/extensions/template/template_decode.sv $(RISC_MGMT)/extensions/template/template_execute.sv $(RISC_MGMT)/extensions/template/template_memory.sv
CORE_PKG_FILES := $(RISCV_PKGS)/rv32i_types_pkg.sv $(RISCV_PKGS)/alu_types_pkg.sv $(RISCV_PKGS)/risc_mgmt/template_pkg.sv $(RISCV_PKGS)/risc_mgmt/crc32_pkg.sv $(RISCV_PKGS)/risc_mgmt/rv32m_pkg.sv $(RISCV_PKGS)/risc_mgmt/test_pkg.sv $(RISCV_PKGS)/machine_mode_types_pkg.sv $(RISCV_PKGS)/machine_mode_types_1_12_pkg.sv $(RISCV_PKGS)/pma_types_1_12_pkg.sv
CORE_FILES := $(RISCV_CORE)/alu.sv $(RISCV_CORE)/branch_res.sv $(RISCV_CORE)/control_unit.sv $(RISCV_CORE)/dmem_extender.sv $(RISCV_CORE)/endian_swapper.sv $(RISCV_CORE)/jump_calc.sv $(RISCV_CORE)/memory_controller.sv $(RISCV_CORE)/RISCVBusiness.sv $(RISCV_CORE)/rv32i_reg_file.sv $(RISCV_CORE)/top_core.sv
PIPELINE_FILES := $(PIPELINE)/tspp/tspp_execute_stage.sv $(PIPELINE)/tspp/tspp_fetch_stage.sv $(PIPELINE)/tspp/tspp_hazard_unit.sv #$(PIPELINE)/tspp/tspp.sv
PREDICTOR_FILES := $(BRANCH_PREDICT)/branch_predictor_wrapper.sv $(BRANCH_PREDICT)/nottaken_predictor/nottaken_predictor.sv
PRIV_FILES := $(PRIVS)/priv_wrapper.sv $(PRIVS)/priv_1_12/priv_1_12_block.sv $(PRIVS)/priv_1_12/priv_1_12_int_ex_handler.sv $(PRIVS)/priv_1_12/priv_1_12_csr.sv $(PRIVS)/priv_1_12/priv_1_12_pipe_control.sv $(PRIVS)/priv_1_12/priv_1_12_pma.sv
CACHE_FILES := $(CACHES)/caches_wrapper.sv $(CACHES)/pass_through/pass_through_cache.sv $(CACHES)/direct_mapped_tpf/direct_mapped_tpf_cache.sv $(CACHES)/separate_caches.sv
SPARCE_FILES := $(SPARCE)/sparce_wrapper.sv $(SPARCE)/sparce_disabled/sparce_disabled.sv $(SPARCE)/sparce_enabled/sparce_cfid.sv $(SPARCE)/sparce_enabled/sparce_enabled.sv $(SPARCE)/sparce_enabled/sparce_psru.sv $(SPARCE)/sparce_enabled/sparce_sasa_table.sv $(SPARCE)/sparce_enabled/sparce_sprf.sv $(SPARCE)/sparce_enabled/sparce_svc.sv
RISCV_BUS_FILES := $(RISCV_BUS)/generic_nonpipeline.sv $(RISCV_BUS)/ahb.sv
TRACKER_FILES := $(RISCV)/trackers/cpu_tracker.sv $(RISCV)/trackers/branch_tracker.sv

COMPONENT_FILES_SV := $(CORE_PKG_FILES) $(RISC_MGMT_FILES) $(RISC_EXT_FILES) $(CORE_FILES) $(RV32C_FILES) $(PIPELINE_FILES) $(SPARCE_FILES) $(PREDICTOR_FILES) $(PRIV_FILES) $(CACHE_FILES) $(RISCV_BUS_FILES) $(TRACKER_FILES)

TOP_ENTITY := RISCVBusiness

HEADER_FILES := -I$(RISCV)/include


define USAGE
@echo "----------------------------------------------------------------------"
@echo " Build Targets:"
@echo " config: config core with example.yml"
@echo " verilate: Invoke 'FuseSoC run --build' to build Verilator target"
@echo " xcelium: Invoke 'FuseSoC run --build' to build Xcelium target"
@echo " lint: Invoke 'FuseSoC run --build' to run the Verilator lint target"
@echo " clean: Remove build directories"
@echo " veryclean: Remove fusesoc libraries & build directories"
@echo "----------------------------------------------------------------------"
endef

.phony: default clean config verilate xcelium


default:
$(USAGE)

config:
@echo "----------------------"
@echo " Running config_core"
@echo "----------------------"
@python3 scripts/config_core.py example.yml

verilate: config
@fusesoc --cores-root . run --setup --build --build-root rvb_out --target sim --tool verilator socet:riscv:RISCVBusiness --make_options='-j'
@echo "------------------------------------------------------------------"
@echo "Build finished, you can run with 'fusesoc run', or by navigating"
@echo "to the build directory created by FuseSoC and using the Makefile there."
@echo "------------------------------------------------------------------"

no_mem: config
@fusesoc --cores-root . run --setup --build --build-root rvb_out --target no_mc --tool verilator socet:riscv:RISCVBusiness --make_options='-j'
@echo "------------------------------------------------------------------"
@echo "Build finished, you can run with 'fusesoc run', or by navigating"
@echo "to the build directory created by FuseSoC and using the Makefile there."
@echo "------------------------------------------------------------------"

xcelium: config
@fusesoc --cores-root . run --setup --build --build-root rvb_out --target sim --tool xcelium socet:riscv:RISCVBusiness
@echo "Build finished, you can run with 'fusesoc run', or by navigating"
@echo "to the build directory created by FuseSoC and using the Makefile there."

lint: config
@fusesoc --cores-root . run --setup --build --build-root rvb_out --target lint --tool verilator socet:riscv:RISCVBusiness
@echo "Lint finished, no errors found"

clean:
rm -rf build
rm -rf rvb_out

veryclean:
rm -rf fusesoc_libraries
rm fusesoc.conf
41 changes: 32 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,43 @@ Design documents and project information for the RISC-V Business project can be
[RISCV-Business Documentation](https://wiki.itap.purdue.edu/display/RISC/RISCV-Business)

**Current User-Level ISA Spec :** v2.1
**Current Privileged ISA Spec :** v1.11
**Current Privileged ISA Spec :** v1.12

# Getting Started

Getting started with RISCV Business consists of three steps: setting up the RISCV tool-chain, setting up the WAF build system, and finally interacting with the RISCV Business project itself.

## Fusesoc
This project uses the [Fusesoc](http://fusesoc.net/) build system. Use the following commands to get started...

```bash
# install project dependencies &
# setup git pre-commit hook
./setup.sh

# For ease of use, use the makefile to run FuseSoC tests
make # shows all build targets available

# configure the RISC-V core
make config
# or python3 scripts/config_core.py <custom>.yml
# if you want to use a config other than example.yml

make verilate # build with Verilator, or...
make xcelium # build with Xcelium
```

> Congrats! All dependencies are now set up. Now you can run simulations/tests:


```bash
# Run ISA tests
run_tests_verilator.py

# Run specify binary on Verliator core simulation
./rvb_out/sim-verilator/Vtop_core meminit.bin
```

## Generating RISC-V tool-chain

Refer to the following link for instructions on installing the RISC-V software tools:
Expand All @@ -36,14 +67,6 @@ Then run after setting the environment variable "RISCV" to your install location
./build.sh
~~~

## Installing the build environment

RISCVBusiness uses SoCFoundationFlow, built off of the waf build system. The following repository contains the source for waf:

[SoCFoundationFlow](https://github.com/mattaw/SoCFoundationFlow)

Refer to SoCFoundationFlow for installation instructions.

## Setup and Run RISCV Business

First, clone the repository
Expand Down
Loading