Merge remote-tracking branch 'upstream/main' into graphics
This commit is contained in:
13
.github/actions/create-conda-env/action.yml
vendored
13
.github/actions/create-conda-env/action.yml
vendored
@@ -11,15 +11,18 @@ runs:
|
||||
echo "Creating a conda environment for each toolchain with the toolchain installed"
|
||||
conda activate base
|
||||
conda-lock install --conda $(which conda) -n ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-riscv-tools ./conda-reqs/conda-lock-reqs/conda-requirements-riscv-tools-linux-64.conda-lock.yml
|
||||
conda-lock install --conda $(which conda) -n ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-esp-tools ./conda-reqs/conda-lock-reqs/conda-requirements-esp-tools-linux-64.conda-lock.yml
|
||||
conda deactivate
|
||||
|
||||
echo "Add extra toolchain collateral to RISC-V install area"
|
||||
echo "Add extra toolchain collateral + CIRCT to RISC-V install area"
|
||||
git submodule update --init ./tools/install-circt
|
||||
conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-riscv-tools
|
||||
./scripts/build-toolchain-extra.sh riscv-tools -p $CONDA_PREFIX/riscv-tools
|
||||
conda deactivate
|
||||
conda activate ${{ env.conda-env-name-no-time }}-$(date --date "${{ env.workflow-timestamp }}" +%Y%m%d)-esp-tools
|
||||
./scripts/build-toolchain-extra.sh esp-tools -p $CONDA_PREFIX/esp-tools
|
||||
./tools/install-circt/bin/download-release-or-nightly-circt.sh \
|
||||
-f circt-full-shared-linux-x64.tar.gz \
|
||||
-i $CONDA_PREFIX \
|
||||
-v version-file \
|
||||
-x ./conda-reqs/circt.json \
|
||||
-g ${{ github.token }}
|
||||
conda deactivate
|
||||
fi
|
||||
shell: bash -leo pipefail {0}
|
||||
|
||||
12
.github/scripts/check-commit.sh
vendored
12
.github/scripts/check-commit.sh
vendored
@@ -45,7 +45,7 @@ search () {
|
||||
done
|
||||
}
|
||||
|
||||
submodules=("cva6" "boom" "ibex" "gemmini" "hwacha" "icenet" "nvdla" "rocket-chip" "sha3" "sifive-blocks" "sifive-cache" "testchipip" "riscv-sodor" "mempress" "bar-fetchers" "shuttle")
|
||||
submodules=("cva6" "boom" "ibex" "gemmini" "hwacha" "icenet" "nvdla" "rocket-chip" "sha3" "rocket-chip-blocks" "rocket-chip-inclusive-cache" "testchipip" "riscv-sodor" "mempress" "bar-fetchers" "shuttle" "constellation" "fft-generator" "hardfloat" "caliptra-aes-acc" "rocc-acc-utils")
|
||||
dir="generators"
|
||||
branches=("master" "main" "dev")
|
||||
search
|
||||
@@ -81,14 +81,20 @@ dir="toolchains"
|
||||
branches=("master")
|
||||
search
|
||||
|
||||
submodules=("firesim")
|
||||
dir="sims"
|
||||
branches=("main")
|
||||
search
|
||||
|
||||
|
||||
submodules=("coremark" "firemarshal" "nvdla-workload" "spec2017")
|
||||
dir="software"
|
||||
branches=("master" "dev")
|
||||
search
|
||||
|
||||
submodules=("DRAMSim2" "axe" "barstools" "dsptools" "rocket-dsp-utils" "torture")
|
||||
submodules=("DRAMSim2" "axe" "barstools" "dsptools" "rocket-dsp-utils" "torture" "fixedpoint" "cde")
|
||||
dir="tools"
|
||||
branches=("master" "dev")
|
||||
branches=("master" "dev" "main")
|
||||
search
|
||||
|
||||
submodules=("fpga-shells")
|
||||
|
||||
18
.github/scripts/defaults.sh
vendored
18
.github/scripts/defaults.sh
vendored
@@ -29,13 +29,13 @@ REMOTE_COURSIER_CACHE=$REMOTE_WORK_DIR/.coursier-cache
|
||||
# key value store to get the build groups
|
||||
declare -A grouping
|
||||
grouping["group-cores"]="chipyard-cva6 chipyard-ibex chipyard-rocket chipyard-hetero chipyard-boom chipyard-sodor chipyard-digitaltop chipyard-multiclock-rocket chipyard-nomem-scratchpad chipyard-spike chipyard-clone chipyard-prefetchers chipyard-shuttle"
|
||||
grouping["group-peripherals"]="chipyard-dmirocket chipyard-dmiboom chipyard-spiflashwrite chipyard-mmios chipyard-nocores chipyard-manyperipherals chipyard-chiplike chipyard-tethered"
|
||||
grouping["group-accels"]="chipyard-mempress chipyard-sha3 chipyard-hwacha chipyard-gemmini chipyard-manymmioaccels chipyard-nvdla"
|
||||
grouping["group-peripherals"]="chipyard-dmirocket chipyard-dmiboom chipyard-spiflashwrite chipyard-mmios chipyard-nocores chipyard-manyperipherals chipyard-chiplike chipyard-tethered chipyard-symmetric"
|
||||
grouping["group-accels"]="chipyard-mempress chipyard-sha3 chipyard-hwacha chipyard-gemmini chipyard-manymmioaccels chipyard-nvdla chipyard-aes256ecb"
|
||||
grouping["group-constellation"]="chipyard-constellation"
|
||||
grouping["group-gpu"]="chipyard-vortex chipyard-coalescer coalescer"
|
||||
grouping["group-tracegen"]="tracegen tracegen-boom"
|
||||
grouping["group-other"]="icenet testchipip constellation rocketchip-amba rocketchip-tlsimple rocketchip-tlwidth rocketchip-tlxbar"
|
||||
grouping["group-fpga"]="arty vcu118 vc707 arty100t"
|
||||
grouping["group-other"]="icenet testchipip constellation rocketchip-amba rocketchip-tlsimple rocketchip-tlwidth rocketchip-tlxbar chipyard-clusters"
|
||||
grouping["group-fpga"]="arty35t arty100t nexysvideo vc707 vcu118"
|
||||
|
||||
# key value store to get the build strings
|
||||
declare -A mapping
|
||||
@@ -59,6 +59,7 @@ mapping["chipyard-spiflashwrite"]=" CONFIG=SmallSPIFlashRocketConfig EXTRA_SIM_F
|
||||
mapping["chipyard-manyperipherals"]=" CONFIG=ManyPeripheralsRocketConfig EXTRA_SIM_FLAGS='+spiflash0=${LOCAL_CHIPYARD_DIR}/tests/spiflash.img'"
|
||||
mapping["chipyard-chiplike"]=" CONFIG=ChipLikeRocketConfig MODEL=FlatTestHarness MODEL_PACKAGE=chipyard.example verilog"
|
||||
mapping["chipyard-tethered"]=" CONFIG=VerilatorCITetheredChipLikeRocketConfig"
|
||||
mapping["chipyard-symmetric"]=" CONFIG=MultiSimSymmetricChipletRocketConfig"
|
||||
mapping["chipyard-cloneboom"]=" CONFIG=Cloned64MegaBoomConfig verilog"
|
||||
mapping["chipyard-nocores"]=" CONFIG=NoCoresConfig verilog"
|
||||
mapping["tracegen"]=" CONFIG=NonBlockingTraceGenL2Config"
|
||||
@@ -68,6 +69,8 @@ mapping["chipyard-shuttle"]=" CONFIG=ShuttleConfig"
|
||||
mapping["chipyard-multiclock-rocket"]=" CONFIG=MulticlockRocketConfig"
|
||||
mapping["chipyard-nomem-scratchpad"]=" CONFIG=MMIOScratchpadOnlyRocketConfig"
|
||||
mapping["chipyard-constellation"]=" CONFIG=SharedNoCConfig"
|
||||
mapping["chipyard-clusters"]=" CONFIG=ClusteredRocketConfig verilog"
|
||||
mapping["chipyard-aes256ecb"]=" CONFIG=AES256ECBRocketConfig"
|
||||
mapping["chipyard-vortex"]=" CONFIG=RadianceROMConfig"
|
||||
mapping["chipyard-coalescer"]=" CONFIG=MemtraceCoreConfig"
|
||||
|
||||
@@ -82,7 +85,8 @@ mapping["rocketchip-tlsimple"]="SUB_PROJECT=rocketchip CONFIG=TLSimpleUnitTestCo
|
||||
mapping["rocketchip-tlwidth"]="SUB_PROJECT=rocketchip CONFIG=TLWidthUnitTestConfig"
|
||||
mapping["rocketchip-tlxbar"]="SUB_PROJECT=rocketchip CONFIG=TLXbarUnitTestConfig"
|
||||
|
||||
mapping["arty"]="SUB_PROJECT=arty verilog"
|
||||
mapping["vcu118"]="SUB_PROJECT=vcu118 verilog"
|
||||
mapping["vc707"]="SUB_PROJECT=vc707 verilog"
|
||||
mapping["arty35t"]="SUB_PROJECT=arty35t verilog"
|
||||
mapping["arty100t"]="SUB_PROJECT=arty100t verilog"
|
||||
mapping["nexysvideo"]="SUB_PROJECT=nexysvideo verilog"
|
||||
mapping["vc707"]="SUB_PROJECT=vc707 verilog"
|
||||
mapping["vcu118"]="SUB_PROJECT=vcu118 verilog"
|
||||
|
||||
4
.github/scripts/run-tests.sh
vendored
4
.github/scripts/run-tests.sh
vendored
@@ -118,6 +118,10 @@ case $1 in
|
||||
make -C $LOCAL_CHIPYARD_DIR/tests
|
||||
run_binary BINARY=$LOCAL_CHIPYARD_DIR/tests/hello.riscv LOADMEM=1 EXTRA_SIM_FLAGS="+cflush_addr=0x2010200"
|
||||
;;
|
||||
chipyard-symmetric)
|
||||
make -C $LOCAL_CHIPYARD_DIR/tests
|
||||
run_binary BINARY=$LOCAL_CHIPYARD_DIR/tests/symmetric.riscv LOADMEM=1
|
||||
;;
|
||||
tracegen)
|
||||
run_tracegen
|
||||
;;
|
||||
|
||||
10
.github/workflows/chipyard-full-flow.yml
vendored
10
.github/workflows/chipyard-full-flow.yml
vendored
@@ -65,7 +65,7 @@ jobs:
|
||||
name: setup-repo
|
||||
needs: [change-filters, cancel-prior-workflows]
|
||||
if: needs.change-filters.outputs.needs-rtl == 'true'
|
||||
runs-on: jktqos
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -88,7 +88,7 @@ jobs:
|
||||
run-cfg-finder:
|
||||
name: run-cfg-finder
|
||||
needs: [setup-repo]
|
||||
runs-on: jktqos
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Run config finder
|
||||
run: |
|
||||
@@ -101,7 +101,7 @@ jobs:
|
||||
run-tutorial:
|
||||
name: run-tutorial
|
||||
needs: [setup-repo]
|
||||
runs-on: jktqos
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Run smoke test
|
||||
run: |
|
||||
@@ -124,7 +124,7 @@ jobs:
|
||||
conda config --add channels litex-hub
|
||||
|
||||
# installs for example-sky130.yml
|
||||
conda create -y --prefix ./.conda-sky130 open_pdks.sky130a=1.0.399_0_g63dbde9
|
||||
conda create -y --prefix ./.conda-sky130 open_pdks.sky130a=1.0.457_0_g32e8f23
|
||||
git clone https://github.com/rahulk29/sram22_sky130_macros.git
|
||||
|
||||
# installs for example-openroad.yml
|
||||
@@ -170,7 +170,7 @@ jobs:
|
||||
cleanup:
|
||||
name: cleanup
|
||||
needs: [run-tutorial]
|
||||
runs-on: jktqos
|
||||
runs-on: as4
|
||||
if: ${{ always() }}
|
||||
steps:
|
||||
- name: Delete repo copy and conda env
|
||||
|
||||
133
.github/workflows/chipyard-run-tests.yml
vendored
133
.github/workflows/chipyard-run-tests.yml
vendored
@@ -62,32 +62,11 @@ jobs:
|
||||
- '**/.gitignore'
|
||||
- '.github/ISSUE_TEMPLATE/**'
|
||||
|
||||
create-conda-env-jktgz:
|
||||
name: create-conda-env-jktgz
|
||||
create-conda-env-as4:
|
||||
name: create-conda-env-as4
|
||||
needs: [change-filters, cancel-prior-workflows]
|
||||
if: needs.change-filters.outputs.needs-rtl == 'true'
|
||||
runs-on: jktgz
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
ls -alh .
|
||||
rm -rf ${{ github.workspace }}/* || true
|
||||
rm -rf ${{ github.workspace }}/.* || true
|
||||
ls -alh .
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Git workaround
|
||||
uses: ./.github/actions/git-workaround
|
||||
- name: Cleanup conda
|
||||
uses: ./.github/actions/cleanup-conda
|
||||
- name: Create conda env
|
||||
uses: ./.github/actions/create-conda-env
|
||||
|
||||
create-conda-env-jktqos:
|
||||
name: create-conda-env-jktqos
|
||||
needs: [change-filters, cancel-prior-workflows]
|
||||
if: needs.change-filters.outputs.needs-rtl == 'true'
|
||||
runs-on: jktqos
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -109,7 +88,7 @@ jobs:
|
||||
# When adding new prep jobs, please add them to `needs` below
|
||||
setup-complete:
|
||||
name: setup-complete
|
||||
needs: [create-conda-env-jktgz, create-conda-env-jktqos]
|
||||
needs: [create-conda-env-as4]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up complete
|
||||
@@ -121,7 +100,7 @@ jobs:
|
||||
name: commit-on-master-check
|
||||
needs: [setup-complete]
|
||||
if: needs.change-filters.outputs.needs-rtl == 'true'
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -144,7 +123,7 @@ jobs:
|
||||
name: tutorial-setup-check
|
||||
needs: [setup-complete]
|
||||
if: needs.change-filters.outputs.needs-rtl == 'true'
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -166,7 +145,7 @@ jobs:
|
||||
documentation-check:
|
||||
name: documentation-check
|
||||
needs: [setup-complete]
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -192,7 +171,7 @@ jobs:
|
||||
name: build-extra-tests
|
||||
needs: [setup-complete]
|
||||
if: needs.change-filters.outputs.needs-rtl == 'true'
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -224,7 +203,7 @@ jobs:
|
||||
prepare-chipyard-cores:
|
||||
name: prepare-chipyard-cores
|
||||
needs: setup-complete
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -246,7 +225,7 @@ jobs:
|
||||
prepare-chipyard-constellation:
|
||||
name: prepare-chipyard-constellation
|
||||
needs: setup-complete
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -268,7 +247,7 @@ jobs:
|
||||
prepare-chipyard-peripherals:
|
||||
name: prepare-chipyard-peripherals
|
||||
needs: setup-complete
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -290,7 +269,7 @@ jobs:
|
||||
prepare-chipyard-accels:
|
||||
name: prepare-chipyard-accels
|
||||
needs: setup-complete
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -312,7 +291,7 @@ jobs:
|
||||
prepare-chipyard-tracegen:
|
||||
name: prepare-chipyard-tracegen
|
||||
needs: setup-complete
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -334,7 +313,7 @@ jobs:
|
||||
prepare-chipyard-other:
|
||||
name: prepare-chipyard-other
|
||||
needs: setup-complete
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -356,7 +335,7 @@ jobs:
|
||||
prepare-chipyard-fpga:
|
||||
name: prepare-chipyard-fpga
|
||||
needs: setup-complete
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -381,7 +360,7 @@ jobs:
|
||||
chipyard-spike-gemmini-run-tests:
|
||||
name: chipyard-spike-gemmini-run-tests
|
||||
needs: prepare-chipyard-accels # technically doesn't depend on RTL but should be after the build.sh for Gemmini
|
||||
runs-on: jktqos
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -410,7 +389,7 @@ jobs:
|
||||
chipyard-rocket-run-tests:
|
||||
name: chipyard-rocket-run-tests
|
||||
needs: prepare-chipyard-cores
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -433,7 +412,7 @@ jobs:
|
||||
chipyard-prefetchers-run-tests:
|
||||
name: chipyard-prefetchers-run-tests
|
||||
needs: prepare-chipyard-cores
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -456,7 +435,7 @@ jobs:
|
||||
chipyard-hetero-run-tests:
|
||||
name: chipyard-hetero-run-tests
|
||||
needs: prepare-chipyard-cores
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -479,7 +458,7 @@ jobs:
|
||||
chipyard-boom-run-tests:
|
||||
name: chipyard-boom-run-tests
|
||||
needs: prepare-chipyard-cores
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -502,7 +481,7 @@ jobs:
|
||||
chipyard-shuttle-run-tests:
|
||||
name: chipyard-shuttle-run-tests
|
||||
needs: prepare-chipyard-cores
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -525,7 +504,7 @@ jobs:
|
||||
chipyard-cva6-run-tests:
|
||||
name: chipyard-cva6-run-tests
|
||||
needs: prepare-chipyard-cores
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -548,7 +527,7 @@ jobs:
|
||||
chipyard-ibex-run-tests:
|
||||
name: chipyard-ibex-run-tests
|
||||
needs: prepare-chipyard-cores
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -571,7 +550,7 @@ jobs:
|
||||
chipyard-sodor-run-tests:
|
||||
name: chipyard-sodor-run-tests
|
||||
needs: prepare-chipyard-cores
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -594,7 +573,7 @@ jobs:
|
||||
chipyard-spike-run-tests:
|
||||
name: chipyard-spike-run-tests
|
||||
needs: prepare-chipyard-cores
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -617,7 +596,7 @@ jobs:
|
||||
chipyard-dmirocket-run-tests:
|
||||
name: chipyard-dmirocket-run-tests
|
||||
needs: prepare-chipyard-peripherals
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -640,7 +619,7 @@ jobs:
|
||||
chipyard-dmiboom-run-tests:
|
||||
name: chipyard-dmiboom-run-tests
|
||||
needs: prepare-chipyard-peripherals
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -663,7 +642,7 @@ jobs:
|
||||
chipyard-spiflashwrite-run-tests:
|
||||
name: chipyard-spiflashwrite-run-tests
|
||||
needs: prepare-chipyard-peripherals
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -686,7 +665,7 @@ jobs:
|
||||
chipyard-manyperipherals-run-tests:
|
||||
name: chipyard-manyperipherals-run-tests
|
||||
needs: prepare-chipyard-peripherals
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -709,7 +688,7 @@ jobs:
|
||||
chipyard-tethered-run-tests:
|
||||
name: chipyard-tethered-run-tests
|
||||
needs: prepare-chipyard-peripherals
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -729,10 +708,33 @@ jobs:
|
||||
group-key: "group-peripherals"
|
||||
project-key: "chipyard-tethered"
|
||||
|
||||
chipyard-symmetric-run-tests:
|
||||
name: chipyard-symmetric-run-tests
|
||||
needs: prepare-chipyard-peripherals
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
ls -alh .
|
||||
rm -rf ${{ github.workspace }}/* || true
|
||||
rm -rf ${{ github.workspace }}/.* || true
|
||||
ls -alh .
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Git workaround
|
||||
uses: ./.github/actions/git-workaround
|
||||
- name: Create conda env
|
||||
uses: ./.github/actions/create-conda-env
|
||||
- name: Run tests
|
||||
uses: ./.github/actions/run-tests
|
||||
with:
|
||||
group-key: "group-peripherals"
|
||||
project-key: "chipyard-symmetric"
|
||||
|
||||
chipyard-sha3-run-tests:
|
||||
name: chipyard-sha3-run-tests
|
||||
needs: prepare-chipyard-accels
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -755,7 +757,7 @@ jobs:
|
||||
chipyard-gemmini-run-tests:
|
||||
name: chipyard-gemmini-run-tests
|
||||
needs: prepare-chipyard-accels
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -778,7 +780,7 @@ jobs:
|
||||
chipyard-manymmioaccels-run-tests:
|
||||
name: chipyard-manymmioaccels-run-tests
|
||||
needs: prepare-chipyard-accels
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -801,7 +803,7 @@ jobs:
|
||||
# chipyard-nvdla-run-tests:
|
||||
# name: chipyard-nvdla-run-tests
|
||||
# needs: prepare-chipyard-accels
|
||||
# runs-on: self-hosted
|
||||
# runs-on: as4
|
||||
# steps:
|
||||
# - name: Delete old checkout
|
||||
# run: |
|
||||
@@ -824,7 +826,7 @@ jobs:
|
||||
chipyard-mempress-run-tests:
|
||||
name: chipyard-mempress-run-tests
|
||||
needs: prepare-chipyard-accels
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -848,7 +850,7 @@ jobs:
|
||||
tracegen-boom-run-tests:
|
||||
name: tracegen-boom-run-tests
|
||||
needs: prepare-chipyard-tracegen
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -871,7 +873,7 @@ jobs:
|
||||
tracegen-run-tests:
|
||||
name: tracegen-run-tests
|
||||
needs: prepare-chipyard-tracegen
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -894,7 +896,7 @@ jobs:
|
||||
icenet-run-tests:
|
||||
name: icenet-run-tests
|
||||
needs: prepare-chipyard-other
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -917,7 +919,7 @@ jobs:
|
||||
testchipip-run-tests:
|
||||
name: testchipip-run-tests
|
||||
needs: prepare-chipyard-other
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -940,7 +942,7 @@ jobs:
|
||||
rocketchip-run-tests:
|
||||
name: rocketchip-run-tests
|
||||
needs: prepare-chipyard-other
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -979,7 +981,7 @@ jobs:
|
||||
constellation-run-tests:
|
||||
name: constellation-run-tests
|
||||
needs: prepare-chipyard-other
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -1002,7 +1004,7 @@ jobs:
|
||||
chipyard-constellation-run-tests:
|
||||
name: chipyard-constellation-run-tests
|
||||
needs: prepare-chipyard-constellation
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -1026,7 +1028,7 @@ jobs:
|
||||
firesim-run-tests:
|
||||
name: firesim-run-tests
|
||||
needs: setup-complete
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -1050,7 +1052,7 @@ jobs:
|
||||
fireboom-run-tests:
|
||||
name: fireboom-run-tests
|
||||
needs: setup-complete
|
||||
runs-on: self-hosted
|
||||
runs-on: as4
|
||||
steps:
|
||||
- name: Delete old checkout
|
||||
run: |
|
||||
@@ -1092,6 +1094,7 @@ jobs:
|
||||
chipyard-spiflashwrite-run-tests,
|
||||
chipyard-manyperipherals-run-tests,
|
||||
chipyard-tethered-run-tests,
|
||||
chipyard-symmetric-run-tests,
|
||||
chipyard-sha3-run-tests,
|
||||
chipyard-gemmini-run-tests,
|
||||
chipyard-manymmioaccels-run-tests, # chipyard-nvdla-run-tests,
|
||||
|
||||
25
.github/workflows/update-circt.yml
vendored
Normal file
25
.github/workflows/update-circt.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: update-circt
|
||||
|
||||
# run daily
|
||||
on:
|
||||
schedule:
|
||||
- cron: 0,15,30,45 * * * *
|
||||
#- cron: 0 8 * * *
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -leo pipefail {0}
|
||||
|
||||
jobs:
|
||||
update-circt:
|
||||
name: update-circt
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Update CIRCT
|
||||
uses: circt/update-circt@v1.0.0
|
||||
with:
|
||||
user: 'bartender'
|
||||
email: 'firesimchipyard@gmail.com'
|
||||
pr-reviewers: ''
|
||||
pr-labels: 'changelog:changed'
|
||||
circt-config: './conda-reqs/circt.json'
|
||||
27
.gitmodules
vendored
27
.gitmodules
vendored
@@ -13,9 +13,6 @@
|
||||
[submodule "generators/boom"]
|
||||
path = generators/boom
|
||||
url = https://github.com/riscv-boom/riscv-boom.git
|
||||
[submodule "generators/sifive-blocks"]
|
||||
path = generators/sifive-blocks
|
||||
url = https://github.com/chipsalliance/rocket-chip-blocks.git
|
||||
[submodule "generators/hwacha"]
|
||||
path = generators/hwacha
|
||||
url = https://github.com/ucb-bar/hwacha.git
|
||||
@@ -25,9 +22,6 @@
|
||||
[submodule "generators/icenet"]
|
||||
path = generators/icenet
|
||||
url = https://github.com/firesim/icenet.git
|
||||
[submodule "generators/block-inclusivecache-sifive"]
|
||||
path = generators/sifive-cache
|
||||
url = https://github.com/chipsalliance/rocket-chip-inclusive-cache.git
|
||||
[submodule "tools/dsptools"]
|
||||
path = tools/dsptools
|
||||
url = https://github.com/ucb-bar/dsptools.git
|
||||
@@ -64,6 +58,9 @@
|
||||
[submodule "software/nvdla-workload"]
|
||||
path = software/nvdla-workload
|
||||
url = https://github.com/ucb-bar/nvdla-workload.git
|
||||
[submodule "software/baremetal-ide"]
|
||||
path = software/baremetal-ide
|
||||
url = https://github.com/ucb-bar/Baremetal-IDE.git
|
||||
[submodule "generators/riscv-sodor"]
|
||||
path = generators/riscv-sodor
|
||||
url = https://github.com/ucb-bar/riscv-sodor.git
|
||||
@@ -133,6 +130,24 @@
|
||||
[submodule "generators/hardfloat"]
|
||||
path = generators/hardfloat
|
||||
url = https://github.com/ucb-bar/berkeley-hardfloat.git
|
||||
[submodule "generators/caliptra-aes-acc"]
|
||||
path = generators/caliptra-aes-acc
|
||||
url = https://github.com/ucb-bar/caliptra-aes-acc
|
||||
[submodule "generators/rocc-acc-utils"]
|
||||
path = generators/rocc-acc-utils
|
||||
url = https://github.com/ucb-bar/rocc-acc-utils
|
||||
[submodule "tools/install-circt"]
|
||||
path = tools/install-circt
|
||||
url = https://github.com/circt/install-circt/
|
||||
[submodule "toolchains/riscv-tools/riscv-spike-devices"]
|
||||
path = toolchains/riscv-tools/riscv-spike-devices
|
||||
url = https://github.com/ucb-bar/spike-devices.git
|
||||
[submodule "generators/rocket-chip-blocks"]
|
||||
path = generators/rocket-chip-blocks
|
||||
url = https://github.com/chipsalliance/rocket-chip-blocks.git
|
||||
[submodule "generators/rocket-chip-inclusive-cache"]
|
||||
path = generators/rocket-chip-inclusive-cache
|
||||
url = https://github.com/chipsalliance/rocket-chip-inclusive-cache.git
|
||||
[submodule "generators/rocket-gpu"]
|
||||
path = generators/rocket-gpu
|
||||
url = git@github.com:hansungk/rocket-gpu.git
|
||||
|
||||
@@ -85,7 +85,7 @@ These additional publications cover many of the internal components used in Chip
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
This work is supported by the NSF CCRI ENS Chipyard Award #201662.
|
||||
This work is supported by the NSF CCRI ENS Chipyard Award #2016662.
|
||||
|
||||
[hwacha]:https://www2.eecs.berkeley.edu/Pubs/TechRpts/2015/EECS-2015-262.pdf
|
||||
[hammer]:https://github.com/ucb-bar/hammer
|
||||
|
||||
26
build.sbt
26
build.sbt
@@ -95,7 +95,7 @@ lazy val chiselSettings = Seq(
|
||||
|
||||
// -- Rocket Chip --
|
||||
|
||||
lazy val hardfloat = freshProject("hardfloat", rocketChipDir / "hardfloat/hardfloat")
|
||||
lazy val hardfloat = freshProject("hardfloat", file("generators/hardfloat/hardfloat"))
|
||||
.settings(chiselSettings)
|
||||
.dependsOn(midasTargetUtils)
|
||||
.settings(commonSettings)
|
||||
@@ -141,17 +141,17 @@ lazy val rocketLibDeps = (rocketchip / Keys.libraryDependencies)
|
||||
lazy val midasTargetUtils = ProjectRef(firesimDir, "targetutils")
|
||||
|
||||
lazy val testchipip = (project in file("generators/testchipip"))
|
||||
.dependsOn(rocketchip, sifive_blocks)
|
||||
.dependsOn(rocketchip, rocketchip_blocks)
|
||||
.settings(libraryDependencies ++= rocketLibDeps.value)
|
||||
.settings(commonSettings)
|
||||
|
||||
lazy val chipyard = (project in file("generators/chipyard"))
|
||||
.dependsOn(testchipip, rocketchip, boom, hwacha, sifive_blocks, sifive_cache, iocell,
|
||||
.dependsOn(testchipip, rocketchip, boom, hwacha, rocketchip_blocks, rocketchip_inclusive_cache, iocell,
|
||||
radiance,
|
||||
sha3, // On separate line to allow for cleaner tutorial-setup patches
|
||||
dsptools, rocket_dsp_utils,
|
||||
gemmini, icenet, tracegen, cva6, nvdla, sodor, ibex, fft_generator,
|
||||
constellation, mempress, barf, shuttle)
|
||||
constellation, mempress, barf, shuttle, caliptra_aes)
|
||||
.settings(libraryDependencies ++= rocketLibDeps.value)
|
||||
.settings(
|
||||
libraryDependencies ++= Seq(
|
||||
@@ -181,7 +181,7 @@ lazy val fft_generator = (project in file("generators/fft-generator"))
|
||||
.settings(commonSettings)
|
||||
|
||||
lazy val tracegen = (project in file("generators/tracegen"))
|
||||
.dependsOn(testchipip, rocketchip, sifive_cache, boom)
|
||||
.dependsOn(testchipip, rocketchip, rocketchip_inclusive_cache, boom)
|
||||
.settings(libraryDependencies ++= rocketLibDeps.value)
|
||||
.settings(commonSettings)
|
||||
|
||||
@@ -240,6 +240,16 @@ lazy val nvdla = (project in file("generators/nvdla"))
|
||||
.settings(libraryDependencies ++= rocketLibDeps.value)
|
||||
.settings(commonSettings)
|
||||
|
||||
lazy val caliptra_aes = (project in file("generators/caliptra-aes-acc"))
|
||||
.dependsOn(rocketchip, rocc_acc_utils, testchipip, midasTargetUtils)
|
||||
.settings(libraryDependencies ++= rocketLibDeps.value)
|
||||
.settings(commonSettings)
|
||||
|
||||
lazy val rocc_acc_utils = (project in file("generators/rocc-acc-utils"))
|
||||
.dependsOn(rocketchip)
|
||||
.settings(libraryDependencies ++= rocketLibDeps.value)
|
||||
.settings(commonSettings)
|
||||
|
||||
lazy val iocell = Project(id = "iocell", base = file("./tools/barstools/") / "iocell")
|
||||
.settings(chiselSettings)
|
||||
.settings(commonSettings)
|
||||
@@ -275,12 +285,12 @@ lazy val rocket_dsp_utils = freshProject("rocket-dsp-utils", file("./tools/rocke
|
||||
.settings(libraryDependencies ++= rocketLibDeps.value)
|
||||
.settings(commonSettings)
|
||||
|
||||
lazy val sifive_blocks = (project in file("generators/sifive-blocks"))
|
||||
lazy val rocketchip_blocks = (project in file("generators/rocket-chip-blocks"))
|
||||
.dependsOn(rocketchip)
|
||||
.settings(libraryDependencies ++= rocketLibDeps.value)
|
||||
.settings(commonSettings)
|
||||
|
||||
lazy val sifive_cache = (project in file("generators/sifive-cache"))
|
||||
lazy val rocketchip_inclusive_cache = (project in file("generators/rocket-chip-inclusive-cache"))
|
||||
.settings(
|
||||
commonSettings,
|
||||
Compile / scalaSource := baseDirectory.value / "design/craft")
|
||||
@@ -300,7 +310,7 @@ lazy val firechip = (project in file("generators/firechip"))
|
||||
Test / testOptions += Tests.Argument("-oF")
|
||||
)
|
||||
lazy val fpga_shells = (project in file("./fpga/fpga-shells"))
|
||||
.dependsOn(rocketchip, sifive_blocks)
|
||||
.dependsOn(rocketchip, rocketchip_blocks)
|
||||
.settings(libraryDependencies ++= rocketLibDeps.value)
|
||||
.settings(commonSettings)
|
||||
|
||||
|
||||
25
common.mk
25
common.mk
@@ -28,7 +28,6 @@ EXTRA_SIM_CXXFLAGS ?=
|
||||
EXTRA_SIM_LDFLAGS ?=
|
||||
EXTRA_SIM_SOURCES ?=
|
||||
EXTRA_SIM_REQS ?=
|
||||
ENABLE_CUSTOM_FIRRTL_PASS += $(ENABLE_YOSYS_FLOW)
|
||||
|
||||
ifneq ($(ASPECTS), )
|
||||
comma = ,
|
||||
@@ -58,7 +57,8 @@ HELP_COMMANDS += \
|
||||
" firrtl = generate intermediate firrtl files from chisel elaboration" \
|
||||
" run-tests = run all assembly and benchmark tests" \
|
||||
" launch-sbt = start sbt terminal" \
|
||||
" find-config-fragments = list all config. fragments"
|
||||
" find-config-fragments = list all config. fragments" \
|
||||
" check-submodule-status = check that all submodules in generators/ have been initialized"
|
||||
|
||||
#########################################################################################
|
||||
# include additional subproject make fragments
|
||||
@@ -84,6 +84,8 @@ endif
|
||||
# Returns a list of files in directories $1 with *any* of the file extensions in $2
|
||||
lookup_srcs_by_multiple_type = $(foreach type,$(2),$(call lookup_srcs,$(1),$(type)))
|
||||
|
||||
CHECK_SUBMODULES_COMMAND = echo "Checking all submodules in generators/ are initialized. Uninitialized submodules will be displayed" ; ! git submodule status $(base_dir)/generators | grep ^-
|
||||
|
||||
SCALA_EXT = scala
|
||||
VLOG_EXT = sv v
|
||||
CHIPYARD_SOURCE_DIRS = $(addprefix $(base_dir)/,generators sims/firesim/sim fpga/fpga-shells fpga/src)
|
||||
@@ -119,12 +121,13 @@ $(BOOTROM_TARGETS): $(build_dir)/bootrom.%.img: $(TESTCHIP_RSRCS_DIR)/testchipip
|
||||
#########################################################################################
|
||||
# compile scala jars
|
||||
#########################################################################################
|
||||
$(CHIPYARD_CLASSPATH_TARGETS) &: $(CHIPYARD_SCALA_SOURCES) $(SCALA_BUILDTOOL_DEPS)
|
||||
$(CHIPYARD_CLASSPATH_TARGETS) &: $(CHIPYARD_SCALA_SOURCES) $(SCALA_BUILDTOOL_DEPS) $(CHIPYARD_VLOG_SOURCES)
|
||||
$(CHECK_SUBMODULES_COMMAND)
|
||||
mkdir -p $(dir $@)
|
||||
$(call run_sbt_assembly,$(SBT_PROJECT),$(CHIPYARD_CLASSPATH))
|
||||
|
||||
# order only dependency between sbt runs needed to avoid concurrent sbt runs
|
||||
$(TAPEOUT_CLASSPATH_TARGETS) &: $(BARSTOOLS_SCALA_SOURCES) $(SCALA_BUILDTOOL_DEPS) | $(CHIPYARD_CLASSPATH_TARGETS)
|
||||
$(TAPEOUT_CLASSPATH_TARGETS) &: $(BARSTOOLS_SCALA_SOURCES) $(SCALA_BUILDTOOL_DEPS) $(BARSTOOLS_VLOG_SOURCES) | $(CHIPYARD_CLASSPATH_TARGETS)
|
||||
mkdir -p $(dir $@)
|
||||
$(call run_sbt_assembly,tapeout,$(TAPEOUT_CLASSPATH))
|
||||
|
||||
@@ -227,7 +230,7 @@ $(FINAL_ANNO_FILE): $(EXTRA_ANNO_FILE) $(SFC_EXTRA_ANNO_FILE) $(SFC_LEVEL)
|
||||
touch $@
|
||||
|
||||
$(SFC_MFC_TARGETS) &: private TMP_DIR := $(shell mktemp -d -t cy-XXXXXXXX)
|
||||
$(SFC_MFC_TARGETS) &: $(TAPEOUT_CLASSPATH_TARGETS) $(FIRRTL_FILE) $(FINAL_ANNO_FILE) $(SFC_LEVEL) $(EXTRA_FIRRTL_OPTIONS) $(MFC_LOWERING_OPTIONS) $(CHIPYARD_VLOG_SOURCES) $(BARSTOOLS_VLOG_SOURCES)
|
||||
$(SFC_MFC_TARGETS) &: $(TAPEOUT_CLASSPATH_TARGETS) $(FIRRTL_FILE) $(FINAL_ANNO_FILE) $(SFC_LEVEL) $(EXTRA_FIRRTL_OPTIONS) $(MFC_LOWERING_OPTIONS)
|
||||
rm -rf $(GEN_COLLATERAL_DIR)
|
||||
$(call run_jar_scala_main,$(TAPEOUT_CLASSPATH),barstools.tapeout.transforms.GenerateModelStageMain,\
|
||||
--no-dedup \
|
||||
@@ -246,9 +249,7 @@ $(SFC_MFC_TARGETS) &: $(TAPEOUT_CLASSPATH_TARGETS) $(FIRRTL_FILE) $(FINAL_ANNO_F
|
||||
@if [ $(shell cat $(SFC_LEVEL)) = low ]; then cat $(TMP_DIR)/unnec-anno-deleted2.sfc.anno.json > $(SFC_ANNO_FILE) && rm $(TMP_DIR)/unnec-anno-deleted.sfc.anno.json && rm $(TMP_DIR)/unnec-anno-deleted2.sfc.anno.json; fi
|
||||
firtool \
|
||||
--format=fir \
|
||||
--dedup \
|
||||
--export-module-hierarchy \
|
||||
--emit-metadata \
|
||||
--verify-each=true \
|
||||
--warn-on-unprocessed-annotations \
|
||||
--disable-annotation-classless \
|
||||
@@ -257,13 +258,13 @@ $(SFC_MFC_TARGETS) &: $(TAPEOUT_CLASSPATH_TARGETS) $(FIRRTL_FILE) $(FINAL_ANNO_F
|
||||
--lowering-options=$(shell cat $(MFC_LOWERING_OPTIONS)) \
|
||||
--repl-seq-mem \
|
||||
--repl-seq-mem-file=$(MFC_SMEMS_CONF) \
|
||||
--repl-seq-mem-circuit=$(MODEL) \
|
||||
--annotation-file=$(SFC_ANNO_FILE) \
|
||||
--split-verilog \
|
||||
-o $(GEN_COLLATERAL_DIR) \
|
||||
$(SFC_FIRRTL_FILE)
|
||||
-mv $(SFC_SMEMS_CONF) $(MFC_SMEMS_CONF) 2> /dev/null
|
||||
$(SED) -i 's/.*/& /' $(MFC_SMEMS_CONF) # need trailing space for SFC macrocompiler
|
||||
touch $(MFC_BB_MODS_FILELIST) # if there are no BB's then the file might not be generated, instead always generate it
|
||||
# DOC include end: FirrtlCompiler
|
||||
|
||||
$(TOP_MODS_FILELIST) $(MODEL_MODS_FILELIST) $(ALL_MODS_FILELIST) $(BB_MODS_FILELIST) $(MFC_MODEL_HRCHY_JSON_UNIQUIFIED) &: $(MFC_MODEL_HRCHY_JSON) $(MFC_TOP_HRCHY_JSON) $(MFC_FILELIST) $(MFC_BB_MODS_FILELIST)
|
||||
@@ -454,6 +455,14 @@ find-config-fragments:
|
||||
help:
|
||||
@for line in $(HELP_LINES); do echo "$$line"; done
|
||||
|
||||
#########################################################################################
|
||||
# Check submodule status
|
||||
#########################################################################################
|
||||
|
||||
.PHONY: check-submodule-status
|
||||
check-submodule-status:
|
||||
$(CHECK_SUBMODULES_COMMAND)
|
||||
|
||||
#########################################################################################
|
||||
# Implicit rule handling
|
||||
#########################################################################################
|
||||
|
||||
@@ -23,13 +23,13 @@ dependencies:
|
||||
# bundle FireSim driver with deps into installer shell-script
|
||||
- constructor
|
||||
|
||||
- gcc<13
|
||||
- gxx<13
|
||||
- gcc<12
|
||||
- gxx<12
|
||||
- sysroot_linux-64=2.17 # needed to match pre-built CI XRT glibc version
|
||||
- conda-gcc-specs
|
||||
- binutils
|
||||
|
||||
- firtool==1.30.0 # from ucb-bar channel - https://github.com/ucb-bar/firtool-feedstock
|
||||
# firtool handled outside of conda
|
||||
|
||||
# misc
|
||||
- autoconf
|
||||
@@ -88,7 +88,7 @@ dependencies:
|
||||
- graphviz
|
||||
- expect
|
||||
- dtc
|
||||
- verilator==5.008
|
||||
- verilator==5.020
|
||||
- screen
|
||||
- elfutils
|
||||
- libdwarf-dev==0.0.0.20190110_28_ga81397fc4 # from ucb-bar channel - using mainline libdwarf-feedstock
|
||||
@@ -102,7 +102,7 @@ dependencies:
|
||||
- sty
|
||||
- open_pdks.sky130a
|
||||
- pip:
|
||||
- hammer-vlsi[asap7]==1.1.2
|
||||
- hammer-vlsi[asap7]==1.2.0
|
||||
|
||||
# doc requirements
|
||||
- sphinx
|
||||
|
||||
3
conda-reqs/circt.json
Normal file
3
conda-reqs/circt.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"version": "firtool-1.60.0"
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -53,9 +53,9 @@ System Components:
|
||||
**icenet**
|
||||
A Network Interface Controller (NIC) designed to achieve up to 200 Gbps.
|
||||
|
||||
**sifive-blocks**
|
||||
System components implemented by SiFive and used by SiFive projects, designed to be integrated with the Rocket Chip generator.
|
||||
These system and peripheral components include UART, SPI, JTAG, I2C, PWM, and other peripheral and interface devices.
|
||||
**rocket-chip-blocks**
|
||||
System components originally implemented by SiFive and used by SiFive projects, designed to be integrated with the Rocket Chip generator.
|
||||
Now maintained by Chips Alliance. These system and peripheral components include UART, SPI, JTAG, I2C, PWM, and other peripheral and interface devices.
|
||||
|
||||
**AWL (Analog Widget Library)**
|
||||
Digital components required for integration with high speed serial links.
|
||||
@@ -106,6 +106,9 @@ Software
|
||||
FireMarshal is the default workload generation tool that Chipyard uses to create software to run on its platforms.
|
||||
See :ref:`fire-marshal` for more information.
|
||||
|
||||
**Baremetal-IDE**
|
||||
Baremetal-IDE is an all-in-one tool for baremetal-level C/C++ program development. See `Tutorial <https://ucb-bar.gitbook.io/chipyard/baremetal-ide/getting-started-with-baremetal-ide/>`_ for more information.
|
||||
|
||||
Sims
|
||||
-------------------------------------------
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ This is done by the following:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
conda install -n base conda-lock=1.4
|
||||
conda install -n base conda-lock==1.4.0
|
||||
conda activate base
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Device Tree Binary (dtb) which details the components of the system.
|
||||
The assembly for the BootROM code is located in
|
||||
`generators/testchipip/src/main/resources/testchipip/bootrom/bootrom.S <https://github.com/ucb-bar/testchipip/blob/master/src/main/resources/testchipip/bootrom/bootrom.S>`_.
|
||||
The BootROM address space starts at ``0x10000`` (determined by the ``BootROMParams`` key in the configuration) and execution starts at address
|
||||
``0x10040`` (given by the linker script and reset vector in the ``BootROMParams``), which is marked by the ``_hang`` label in the BootROM assembly.
|
||||
``0x10000`` (given by the linker script and reset vector in the ``BootROMParams``), which is marked by the ``_hang`` label in the BootROM assembly.
|
||||
|
||||
The Chisel generator encodes the assembled instructions into the BootROM
|
||||
hardware at elaboration time, so if you want to change the BootROM code, you
|
||||
|
||||
@@ -59,7 +59,7 @@ should look something like this:
|
||||
.. code-block:: scala
|
||||
|
||||
lazy val chipyard = (project in file("generators/chipyard"))
|
||||
.dependsOn(testchipip, rocketchip, boom, hwacha, sifive_blocks, sifive_cache, iocell,
|
||||
.dependsOn(testchipip, rocketchip, boom, hwacha, rocketchip_blocks, rocketchip_inclusive_cache, iocell,
|
||||
sha3, dsptools, `rocket-dsp-utils`,
|
||||
gemmini, icenet, tracegen, cva6, nvdla, sodor, ibex, fft_generator,
|
||||
yourproject, // <- added to the middle of the list for simplicity
|
||||
|
||||
@@ -13,7 +13,7 @@ The ``IOBinder`` functions are responsible for instantiating IO cells and IOPort
|
||||
For example, the ``WithUARTIOCells`` IOBinder will, for any ``System`` that might have UART ports (``HasPeripheryUARTModuleImp``, generate ports within the ``ChipTop`` (``ports``) as well as IOCells with the appropriate type and direction (``cells2d``). This function returns a the list of generated ports, and the list of generated IOCells. The list of generated ports is passed to the ``HarnessBinders`` such that they can be connected to ``TestHarness`` devices.
|
||||
|
||||
|
||||
.. literalinclude:: ../../generators/chipyard/src/main/scala/IOBinders.scala
|
||||
.. literalinclude:: ../../generators/chipyard/src/main/scala/iobinders/IOBinders.scala
|
||||
:language: scala
|
||||
:start-after: DOC include start: WithUARTIOCells
|
||||
:end-before: DOC include end: WithUARTIOCells
|
||||
|
||||
@@ -161,4 +161,31 @@ transformed or augmented by any Chipyard FIRRTL transform.
|
||||
As mentioned earlier in this section, ``BlackBox`` resource files must
|
||||
be integrated into the build process, so any project providing
|
||||
``BlackBox`` resources must be made visible to the ``tapeout`` project
|
||||
in ``build.sbt``
|
||||
in ``build.sbt``.
|
||||
|
||||
Differences between ``HasBlackBoxPath`` and ``HasBlackBoxResource``
|
||||
-------------------------------------------------------------------
|
||||
|
||||
Chisel provides two mechanisms for integrating blackbox files into a Chisel project that work slightly differently in Chipyard: ``HasBlackBoxPath`` and ``HasBlackBoxResource``.
|
||||
|
||||
``HasBlackBoxResource`` incorporates extra files by looking up the relative path of the files within the ``src/main/resources`` area of project.
|
||||
This requires that the file added by ``addResource`` is present in the ``src/main/resources`` area and is **not** auto-generated (the file is static throughout the lifetime of generating RTL).
|
||||
This is due to the fact that when the Chisel sources are compiled they are put in a ``jar`` file, along with the ``src/main/resources`` area, and that ``jar`` is used to run the Chisel generator.
|
||||
Files referenced by the ``addResource`` must be located within this ``jar`` file during the Chisel elaboration.
|
||||
Thus if a file is generated during Chisel generation it will not be present in the ``jar`` file until the next time the Chisel sources are compiled.
|
||||
|
||||
``HasBlackBoxPath`` differs in that it incorporates extra files by using an absolute path to them.
|
||||
Later in the build process, the FIRRTL compiler will copy the file from that location to the generated sources directory.
|
||||
Thus, the file must be present before the FIRRTL compiler is run (i.e. the file doesn't need to be in the ``src/main/resources`` or it can be auto-generated during Chisel elaboration).
|
||||
|
||||
Additionally, both mechanisms do not enforce the order of files added.
|
||||
For example:
|
||||
|
||||
.. code-block:: scala
|
||||
|
||||
addResource("fileA")
|
||||
addResource("fileB")
|
||||
|
||||
In this case, ``fileA`` is not guaranteed to be before ``fileB`` when passed to downstream tools.
|
||||
To bypass this, it is recommended to auto-generate a single file with the ordering needed by concatenating the files and using ``addPath`` given by ``HasBlackBoxPath``.
|
||||
An example of this is https://github.com/ucb-bar/ibex-wrapper/blob/main/src/main/scala/IbexCoreBlackbox.scala.
|
||||
|
||||
@@ -46,17 +46,17 @@ agents and MMIO peripherals. Ordinarily, it is a fully-connected crossbar, but
|
||||
a network-on-chip-based implementation can be generated using Constellation.
|
||||
See :ref:`Customization/NoC-SoCs:SoCs with NoC-based Interconnects` for more.
|
||||
|
||||
The SiFive L2 Cache
|
||||
-------------------
|
||||
The Inclusive Last-Level Cache
|
||||
---------------------------------
|
||||
|
||||
The default ``RocketConfig`` provided in the Chipyard example project uses SiFive's
|
||||
The default ``RocketConfig`` provided in the Chipyard example project uses the Rocket-Chip
|
||||
InclusiveCache generator to produce a shared L2 cache. In the default
|
||||
configuration, the L2 uses a single cache bank with 512 KiB capacity and 8-way
|
||||
set-associativity. However, you can change these parameters to obtain your
|
||||
desired cache configuration. The main restriction is that the number of ways
|
||||
and the number of banks must be powers of 2.
|
||||
|
||||
Refer to the ``CacheParameters`` object defined in sifive-cache for
|
||||
Refer to the ``CacheParameters`` object defined in ``rocket-chip-inclusive-cache`` for
|
||||
customization options.
|
||||
|
||||
The Broadcast Hub
|
||||
@@ -94,10 +94,10 @@ memory channel.
|
||||
|
||||
Instead of connecting to off-chip DRAM, you can instead connect a scratchpad
|
||||
and remove the off-chip link. This is done by adding a fragment like
|
||||
``testchipip.WithScratchpad`` to your configuration and removing the
|
||||
``testchipip.soc.WithScratchpad`` to your configuration and removing the
|
||||
memory port with ``freechips.rocketchip.subsystem.WithNoMemPort``.
|
||||
|
||||
.. literalinclude:: ../../generators/chipyard/src/main/scala/config/RocketConfigs.scala
|
||||
.. literalinclude:: ../../generators/chipyard/src/main/scala/config/MemorySystemConfigs.scala
|
||||
:language: scala
|
||||
:start-after: DOC include start: mbusscratchpadrocket
|
||||
:end-before: DOC include end: mbusscratchpadrocket
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
SiFive Generators
|
||||
==================
|
||||
Rocket-Chip Generators
|
||||
======================
|
||||
|
||||
Chipyard includes several open-source generators developed and maintained by `SiFive <https://www.sifive.com/>`__.
|
||||
These are currently organized within two submodules named ``sifive-blocks`` and ``sifive-cache``.
|
||||
Chipyard includes several open-source generators developed by `SiFive <https://www.sifive.com/>`__, and now openly maintained as part of Chips Alliance.
|
||||
These are currently organized within two submodules named ``rocket-chip-blocks`` and ``rocket-chip-inclusive-cache``.
|
||||
|
||||
Last-Level Cache Generator
|
||||
-----------------------------
|
||||
|
||||
``sifive-cache`` includes last-level cache geneator. The Chipyard framework uses this last-level cache as an L2 cache. To use this L2 cache, you should add the ``freechips.rocketchip.subsystem.WithInclusiveCache`` config fragment to your SoC configuration.
|
||||
``rocket-chip-inclusive-cache`` includes last-level cache geneator. The Chipyard framework uses this last-level cache as an L2 cache. To use this L2 cache, you should add the ``freechips.rocketchip.subsystem.WithInclusiveCache`` config fragment to your SoC configuration.
|
||||
To learn more about configuring this L2 cache, please refer to the :ref:`memory-hierarchy` section.
|
||||
|
||||
|
||||
Peripheral Devices Overview
|
||||
----------------------------
|
||||
``sifive-blocks`` includes multiple peripheral device generators, such as UART, SPI, PWM, JTAG, GPIO and more.
|
||||
``rocket-chip-blocks`` includes multiple peripheral device generators, such as UART, SPI, PWM, JTAG, GPIO and more.
|
||||
|
||||
These peripheral devices usually affect the memory map of the SoC, and its top-level IO as well.
|
||||
All the peripheral blocks comes with a default memory address that would not collide with each other, but if integrating multiple duplicated blocks in the SoC is needed, you will need to explicitly specify an approriate memory address for that device.
|
||||
@@ -34,7 +34,7 @@ Finally, you add the relevant config fragment to the SoC config. For example:
|
||||
General Purpose I/Os (GPIO) Device
|
||||
----------------------------------
|
||||
|
||||
GPIO device is a periphery device provided by ``sifive-blocks``. Each general-purpose I/O port has five 32-bit configuration registers, two 32-bit data registers controlling pin input and output values, and eight 32-bit interrupt control/status register for signal level and edge triggering. In addition, all GPIOs can have two 32-bit alternate function selection registers.
|
||||
GPIO device is a periphery device provided by ``rocket-chip-blocks``. Each general-purpose I/O port has five 32-bit configuration registers, two 32-bit data registers controlling pin input and output values, and eight 32-bit interrupt control/status register for signal level and edge triggering. In addition, all GPIOs can have two 32-bit alternate function selection registers.
|
||||
|
||||
|
||||
GPIO main features
|
||||
@@ -78,7 +78,7 @@ Including GPIO in the SoC
|
||||
Universal Asynchronous Receiver/Transmitter (UART) Device
|
||||
----------------------------------------------------------
|
||||
|
||||
UART device is a periphery device provided by ``sifive-blocks``. The UART offers a flexible means to perform Full-duplex data exchange with external devices. A very wide range of baud rates can be achieved through a fractional baud rate generator. The UART peripheral does not support other modem control signals, or synchronous serial data transfers.
|
||||
UART device is a periphery device provided by ``rocket-chip-blocks``. The UART offers a flexible means to perform Full-duplex data exchange with external devices. A very wide range of baud rates can be achieved through a fractional baud rate generator. The UART peripheral does not support other modem control signals, or synchronous serial data transfers.
|
||||
|
||||
|
||||
UART main features
|
||||
@@ -125,7 +125,7 @@ Including UART in the SoC
|
||||
Inter-Integrated Circuit (I2C) Interface Device
|
||||
-------------------------------------------------
|
||||
|
||||
I2C device is a periphery device provided by ``sifive-blocks``. The I2C (inter-integrated circuit) bus interface handles communications to the serial I2C bus. It provides multi-master capability, and controls all I2C bus-specific sequencing, protocol, arbitration and timing. It supports Standard-mode (Sm), Fast-mode (Fm) and Fast-mode Plus (Fm+).
|
||||
I2C device is a periphery device provided by ``rocket-chip-blocks``. The I2C (inter-integrated circuit) bus interface handles communications to the serial I2C bus. It provides multi-master capability, and controls all I2C bus-specific sequencing, protocol, arbitration and timing. It supports Standard-mode (Sm), Fast-mode (Fm) and Fast-mode Plus (Fm+).
|
||||
|
||||
|
||||
I2C main features
|
||||
@@ -169,7 +169,7 @@ Including I2C in the SoC
|
||||
Serial Peripheral Interface (SPI) Device
|
||||
-------------------------------------------------
|
||||
|
||||
SPI device is a periphery device provided by ``sifive-blocks``. The SPI interface can be used to communicate with external devices using the SPI protocol.
|
||||
SPI device is a periphery device provided by ``rocket-chip-blocks``. The SPI interface can be used to communicate with external devices using the SPI protocol.
|
||||
|
||||
The serial peripheral interface (SPI) protocol supports half-duplex, full-duplex and simplex synchronous, serial communication with external devices. The interface can be configured as master and in this case it provides the communication clock (SCLK) to the external slave device.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Rocket Chip
|
||||
===========
|
||||
|
||||
Rocket Chip generator is an SoC generator developed at Berkeley and now supported by
|
||||
`SiFive <https://www.sifive.com>`__. Chipyard uses the Rocket Chip generator as the basis for producing a RISC-V SoC.
|
||||
Rocket Chip generator is an SoC generator developed at Berkeley and SiFive, and now maintained openly in Chips Alliance.
|
||||
Chipyard uses the Rocket Chip generator as the basis for producing a RISC-V SoC.
|
||||
|
||||
`Rocket Chip` is distinct from `Rocket core`, the in-order RISC-V CPU generator.
|
||||
Rocket Chip includes many parts of the SoC besides the CPU. Though Rocket Chip
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Rocket Core
|
||||
====================================
|
||||
|
||||
`Rocket <https://github.com/freechipsproject/rocket-chip>`__ is a 5-stage in-order scalar processor core generator, originally developed at UC Berkeley and currently supported by `SiFive <https://www.sifive.com/>`__. The `Rocket core` is used as a component within the `Rocket Chip SoC generator`. A Rocket core combined with L1 caches (data and instruction caches) form a `Rocket tile`. The `Rocket tile` is the replicable component of the `Rocket Chip SoC generator`.
|
||||
`Rocket <https://github.com/freechipsproject/rocket-chip>`__ is a 5-stage in-order scalar processor core generator, originally developed at UC Berkeley and `SiFive <https://www.sifive.com/>`__, and now maintained by Chips Alliance. The `Rocket core` is used as a component within the `Rocket Chip SoC generator`. A Rocket core combined with L1 caches (data and instruction caches) form a `Rocket tile`. The `Rocket tile` is the replicable component of the `Rocket Chip SoC generator`.
|
||||
|
||||
The Rocket core supports the open-source RV64GC RISC-V instruction set and is written in the Chisel hardware construction language.
|
||||
It has an MMU that supports page-based virtual memory, a non-blocking data cache, and a front-end with branch prediction.
|
||||
|
||||
@@ -92,3 +92,15 @@ The SPI flash model is a device that models a simple SPI flash device. It curren
|
||||
only supports single read, quad read, single write, and quad write instructions. The
|
||||
memory is backed by a file which is provided using ``+spiflash#=<NAME_OF_FILE>``,
|
||||
where ``#`` is the SPI flash ID (usually ``0``).
|
||||
|
||||
Chip ID Pin
|
||||
---------------
|
||||
|
||||
The chip ID pin sets the chip ID for the chip it is added to. This is most useful in
|
||||
multi-chip configs. The pin value is driven by the chip ID value set in the harness
|
||||
binder and the chip ID value can be read through MMIO at the address ``0x2000`` by default.
|
||||
|
||||
The pin can be added to a system with the ``testchipip.soc.WithChipIdPin`` config. The pin
|
||||
width and MMIO address are parameterizable and can be set by passing ``ChipIdPinParams`` as an
|
||||
argument to the config. The width can additionally be set using the ``testchipip.soc.WithChipIdPinWidth``
|
||||
config.
|
||||
|
||||
@@ -26,7 +26,7 @@ so changes to the generators themselves will automatically be used when building
|
||||
Gemmini
|
||||
IceNet
|
||||
TestChipIP
|
||||
SiFive-Generators
|
||||
Rocket-Chip-Generators
|
||||
SHA3
|
||||
CVA6
|
||||
Ibex
|
||||
|
||||
@@ -2,18 +2,18 @@ Running a Design on Arty
|
||||
========================
|
||||
|
||||
Arty100T Instructions
|
||||
----------------------
|
||||
---------------------
|
||||
|
||||
The default Xilinx Arty 100T harness uses a TSI-over-UART adapter to bringup the FPGA.
|
||||
A user can connect to the Arty 100T target using a special ``uart_tsi`` program that opens a UART TTY.
|
||||
The default Digilent Arty A7-100T harness uses a TSI-over-UART adapter to bringup the FPGA.
|
||||
A user can connect to the Arty A7-100T target using a special ``uart_tsi`` program that opens a UART TTY.
|
||||
The interface for the ``uart_tsi`` program provides unique functionality that is useful for bringing up test chips.
|
||||
|
||||
To build the design, run:
|
||||
To build the design (Vivado should be added to the ``PATH``), run:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
cd fpga/
|
||||
make SUB_PROJECT=arty100t
|
||||
make SUB_PROJECT=arty100t bitstream
|
||||
|
||||
To build the UART-based frontend server, run:
|
||||
|
||||
@@ -34,7 +34,7 @@ Probe an address on the target system:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
./uart_tsi +tty=/dev/ttyUSBX +init_read=0x10040 none
|
||||
./uart_tsi +tty=/dev/ttyUSBX +init_read=0x10000 none
|
||||
|
||||
Write some address before running a program:
|
||||
|
||||
@@ -58,7 +58,7 @@ Run a design at a higher baud rate than default (For example, if ``CONFIG=UART92
|
||||
Arty35T Legacy Instructions
|
||||
---------------------------
|
||||
|
||||
The default Xilinx Arty 35T harness is setup to have JTAG available over the board's PMOD pins, and UART available over its FTDI serial USB adapter. The pin mappings for JTAG signals are identical to those described in the `SiFive Freedom E310 Arty 35T Getting Started Guide <https://static.dev.sifive.com/SiFive-E310-arty-gettingstarted-v1.0.6.pdf>`__.
|
||||
The default Digilent Arty A7-35T harness is setup to have JTAG available over the board's PMOD pins, and UART available over its FTDI serial USB adapter. The pin mappings for JTAG signals are identical to those described in the `SiFive Freedom E310 Arty 35T Getting Started Guide <https://static.dev.sifive.com/SiFive-E310-arty-gettingstarted-v1.0.6.pdf>`__.
|
||||
The JTAG interface allows a user to connect to the core via OpenOCD, run bare-metal applications, and debug these applications with gdb. UART allows a user to communicate with the core over a USB connection and serial console running on a PC.
|
||||
To extend this design, a user may create their own Chipyard configuration and add the ``WithArtyTweaks`` located in ``fpga/src/main/scala/arty/Configs.scala``.
|
||||
Adding this config. fragment will enable and connect the JTAG and UART interfaces to your Chipyard design.
|
||||
@@ -68,13 +68,13 @@ Adding this config. fragment will enable and connect the JTAG and UART interface
|
||||
:start-after: DOC include start: AbstractArty and Rocket
|
||||
:end-before: DOC include end: AbstractArty and Rocket
|
||||
|
||||
Future peripherals to be supported include the Arty 35T SPI Flash EEPROM, and I2C/PWM/SPI over the Arty 35T GPIO pins. These peripherals are available as part of sifive-blocks.
|
||||
Future peripherals to be supported include the Arty A7-35T SPI Flash EEPROM, and I2C/PWM/SPI over the Arty A7-35T GPIO pins. These peripherals are available as part of sifive-blocks.
|
||||
|
||||
Brief Implementation Description and Guidance for Adding/Changing Xilinx Collateral
|
||||
-----------------------------------------------------------------------------------
|
||||
|
||||
Like the VCU118, the basis for the Arty 35T design is the creation of a special test harness that connects the external IO (which exist as Xilinx IP blackboxes) to the Chipyard design.
|
||||
This is done with the ``ArtyTestHarness`` in the basic default Arty 35T target. However, unlike the ``VCU118TestHarness``, the ``ArtyTestHarness`` uses no ``Overlays``, and instead directly connects chip top IO to the ports of the external IO blackboxes, using functions such as ``IOBUF`` provided by ``fpga-shells``.
|
||||
Unlike the VCU118 and other more complicated test harnesses, the Arty 35T Vivado collateral is not generated by ``Overlays``, but rather are a static collection of ``create_ip`` and ``set_properties`` statements located in the files within ``fpga/fpga-shells/xilinx/arty/tcl`` and ``fpga/fpga-shells/xilinx/arty/constraints``.
|
||||
Like the VCU118, the basis for the Arty A7-35T design is the creation of a special test harness that connects the external IO (which exist as Xilinx IP blackboxes) to the Chipyard design.
|
||||
This is done with the ``ArtyTestHarness`` in the basic default Arty A7-35T target. However, unlike the ``VCU118TestHarness``, the ``ArtyTestHarness`` uses no ``Overlays``, and instead directly connects chip top IO to the ports of the external IO blackboxes, using functions such as ``IOBUF`` provided by ``fpga-shells``.
|
||||
Unlike the VCU118 and other more complicated test harnesses, the Arty A7-35T Vivado collateral is not generated by ``Overlays``, but rather are a static collection of ``create_ip`` and ``set_properties`` statements located in the files within ``fpga/fpga-shells/xilinx/arty/tcl`` and ``fpga/fpga-shells/xilinx/arty/constraints``.
|
||||
If the user wishes to re-map FPGA package pins to different harness-level IO, this may be changed within ``fpga/fpga-shells/xilinx/arty/constraints/arty-master.xdc``. The addition of new Xilinx IP blocks may be done in ``fpga-shells/xilinx/arty/tcl/ip.tcl``, mapped to harness-level IOs in ``arty-master.xdc``, and wired through from the test harness to the chip top using ``HarnessBinders`` and ``IOBinders``.
|
||||
Examples of a simple ``IOBinder`` and ``HarnessBinder`` for routing signals (in this case the debug and JTAG resets) from the core to the test harness are the ``WithResetPassthrough`` and ``WithArtyResetHarnessBinder``.
|
||||
|
||||
@@ -2,7 +2,7 @@ General Setup and Usage
|
||||
==============================
|
||||
|
||||
Sources
|
||||
---------------------------
|
||||
-------
|
||||
|
||||
All FPGA prototyping-related collateral and sources are located in the ``fpga`` top-level Chipyard directory.
|
||||
This includes the ``fpga-shells`` submodule and the ``src`` directory that hold both Scala, TCL and other collateral.
|
||||
|
||||
49
docs/Prototyping/NexysVideo.rst
Normal file
49
docs/Prototyping/NexysVideo.rst
Normal file
@@ -0,0 +1,49 @@
|
||||
Running a Design on Nexys Video
|
||||
===============================
|
||||
|
||||
Nexys Video Instructions
|
||||
------------------------
|
||||
|
||||
The default Digilent Nexys Video harness uses a TSI-over-UART adapter to bringup the FPGA.
|
||||
A user can connect to the Nexys Video target using a special ``uart_tsi`` program that opens a UART TTY.
|
||||
The interface for the ``uart_tsi`` program provides unique functionality that is useful for bringing up test chips.
|
||||
|
||||
To build the design (Vivado should be added to the ``PATH``), run:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
cd fpga/
|
||||
make SUB_PROJECT=nexysvideo bitstream
|
||||
|
||||
To build the UART-based frontend server, run:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
cd generators/testchipip/uart_tsi
|
||||
make
|
||||
|
||||
After programming the bitstream, and connecting the Nexys Video's UART to a host PC via the USB cable, the ``uart_tsi`` program can be run to interact with the target.
|
||||
|
||||
Running a program:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
./uart_tsi +tty=/dev/ttyUSBX dhrystone.riscv
|
||||
|
||||
Probe an address on the target system:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
./uart_tsi +tty=/dev/ttyUSBX +init_read=0x10000 none
|
||||
|
||||
Write some address before running a program:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
./uart_tsi +tty=/dev/ttyUSBX +init_write=0x80000000:0xdeadbeef none
|
||||
|
||||
Self-check that binary loading proceeded correctly:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
./uart_tsi +tty=/dev/ttyUSBX +selfcheck dhrystone.riscv
|
||||
@@ -2,10 +2,10 @@ Prototyping Flow
|
||||
================
|
||||
|
||||
Chipyard supports FPGA prototyping for local FPGAs supported by `fpga-shells <https://github.com/sifive/fpga-shells>`__.
|
||||
This includes popular FPGAs such as the Xilinx VCU118 and the Xilinx Arty 35T board.
|
||||
This includes popular FPGAs such as the Xilinx VCU118 and the Digilent Arty A7-35T/A7-100T board.
|
||||
|
||||
.. Note:: While ``fpga-shells`` provides harnesses for other FPGA development boards such as the Xilinx VC707 and some MicroSemi PolarFire, only harnesses for the Xilinx VCU118 and Xilinx Arty 35T boards are currently supported in Chipyard.
|
||||
However, the VCU118 and Arty 35T examples demonstrate how a user may implement support for other harnesses provided by fpga-shells.
|
||||
.. Note:: While ``fpga-shells`` provides harnesses for other FPGA development boards such as the Xilinx VC707 and some MicroSemi PolarFire, only harnesses for the Xilinx VCU118 and Digilent Arty A7-35T/A7-100T boards are currently supported in Chipyard.
|
||||
However, the VCU118 and Arty A7-35T/A7-100T examples demonstrate how a user may implement support for other harnesses provided by fpga-shells.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
@@ -14,3 +14,4 @@ This includes popular FPGAs such as the Xilinx VCU118 and the Xilinx Arty 35T bo
|
||||
General
|
||||
VCU118
|
||||
Arty
|
||||
NexysVideo
|
||||
|
||||
@@ -81,6 +81,24 @@ For example:
|
||||
|
||||
.. _sw-sim-custom:
|
||||
|
||||
Custom Benchmarks/Tests
|
||||
-------------------------------
|
||||
|
||||
To compile your own bare-metal code to run in a Verilator/VCS simulation, add it to Chipyard's ``tests`` directory then add its name to the list of ``PROGRAMS`` inside the ``Makefile``. These binaries are compiled with the libgloss-htif library, which implements a minimal set of useful syscalls for bare-metal binaries. Then when you run ``make``, all of the programs inside ``tests`` will be compiled into ``.riscv`` ELF binaries, which can be used with the simulator as described above.
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
# Enter Tests directory
|
||||
cd tests
|
||||
make
|
||||
|
||||
# Enter Verilator or VCS directory
|
||||
cd ../sims/verilator
|
||||
make run-binary BINARY=../../tests/hello.riscv
|
||||
|
||||
.. Note:: On multi-core configurations, only hart (**har**\ dware **t**\ hread) 0 executes the ``main()`` function. All other harts execute the secondary ``__main()`` function, which defaults to a busy loop. To run a multi-threaded workload on a Verilator/VCS simulation, override ``__main()`` with your own code. More details can be found `here <https://github.com/ucb-bar/libgloss-htif>`_
|
||||
|
||||
|
||||
Makefile Variables and Commands
|
||||
-------------------------------
|
||||
You can get a list of useful Makefile variables and commands available from the Verilator or VCS directories. simply run ``make help``:
|
||||
|
||||
@@ -50,3 +50,24 @@ Spike-as-a-Tile can be configured with custom IPC, commit logging, and other beh
|
||||
* ``+spike-fast-clint``: Enables fast-forwarding through WFI stalls by generating fake timer interrupts
|
||||
* ``+spike-debug``: Enables debug Spike logging
|
||||
* ``+spike-verbose``: Enables Spike commit-log generation
|
||||
|
||||
Adding a new spike device model
|
||||
-------------------------------
|
||||
|
||||
Spike comes with a few functional device models such as UART, CLINT, and PLIC.
|
||||
However, you may want to add custom device models into Spike such as a block device.
|
||||
Example devices are in the ``toolchains/riscv-tools/riscv-spike-devices`` directory.
|
||||
These devices are compiled as a shared library that can be dynamically linked to Spike.
|
||||
|
||||
To compile these plugins, run ``make`` inside ``toolchains/riscv-tools/riscv-spike-devices``. This will generate a ``libspikedevices.so``.
|
||||
|
||||
To hook up a block device to spike and provide a default image to initialize the block device, run
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
spike --extlib=libspikedevices.so --device="iceblk,img=<path to Linux image>" <path to kernel binary>
|
||||
|
||||
.
|
||||
|
||||
The ``--device`` option consists of the device name and arguments.
|
||||
In the above example ``iceblk`` is the device name and ``img=<path to Linux image>`` is the argument passed on to the plugin device.
|
||||
|
||||
@@ -60,7 +60,7 @@ The prerequisite setup for this tutorial may eventually be scripted, but for now
|
||||
.. code-block:: shell
|
||||
|
||||
# download all files for Sky130A PDK
|
||||
conda create -c litex-hub --prefix ~/.conda-sky130 open_pdks.sky130a=1.0.399_0_g63dbde9
|
||||
conda create -c litex-hub --prefix ~/.conda-sky130 open_pdks.sky130a=1.0.457_0_g32e8f23
|
||||
# clone the SRAM22 Sky130 SRAM macros
|
||||
git clone https://github.com/rahulk29/sram22_sky130_macros ~/sram22_sky130_macros
|
||||
|
||||
@@ -123,8 +123,7 @@ The ``buildfile`` make target has dependencies on both (1) the Verilog that is e
|
||||
and (2) the mapping of memory instances in the design to SRAM macros;
|
||||
all files related to these two steps reside in the ``generated-src/chipyard.harness.TestHarness.TinyRocketConfig-ChipTop`` directory.
|
||||
Note that the files in ``generated-src`` vary for each tool/technology flow.
|
||||
This especially applies to the Sky130 Commercial vs OpenROAD tutorial flows
|
||||
(due to the ``ENABLE_YOSYS_FLOW`` flag present for the OpenROAD flow), so these flows should be run in separate
|
||||
This especially applies to the Sky130 Commercial vs OpenROAD tutorial flows, so these flows should be run in separate
|
||||
chipyard installations. If the wrong sources are generated, simply run ``make buildfile -B`` to rebuild all targets correctly.
|
||||
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ Note that we create a new conda environment for each tool because some of them h
|
||||
conda config --add channels defaults
|
||||
|
||||
# download all files for Sky130A PDK
|
||||
conda create -c litex-hub --prefix ~/.conda-sky130 open_pdks.sky130a=1.0.399_0_g63dbde9
|
||||
conda create -c litex-hub --prefix ~/.conda-sky130 open_pdks.sky130a=1.0.457_0_g32e8f23
|
||||
# clone the SRAM22 Sky130 SRAM macros
|
||||
git clone https://github.com/rahulk29/sram22_sky130_macros ~/sram22_sky130_macros
|
||||
|
||||
@@ -161,8 +161,7 @@ The ``buildfile`` make target has dependencies on both (1) the Verilog that is e
|
||||
and (2) the mapping of memory instances in the design to SRAM macros;
|
||||
all files related to these two steps reside in the ``generated-src/chipyard.harness.TestHarness.TinyRocketConfig-ChipTop`` directory.
|
||||
Note that the files in ``generated-src`` vary for each tool/technology flow.
|
||||
This especially applies to the Sky130 Commercial vs OpenROAD tutorial flows
|
||||
(due to the ``ENABLE_YOSYS_FLOW`` flag, explained below), so these flows should be run in separate
|
||||
This especially applies to the Sky130 Commercial vs OpenROAD tutorial flows, so these flows should be run in separate
|
||||
chipyard installations. If the wrong sources are generated, simply run ``make buildfile -B`` to rebuild all targets correctly.
|
||||
|
||||
|
||||
@@ -175,7 +174,6 @@ which will cause additional variables to be set in ``tutorial.mk``, a few of whi
|
||||
* ``DESIGN_CONF`` and ``EXTRA_CONFS`` allow for additonal design-specific overrides of the Hammer IR in ``example-sky130.yml``
|
||||
* ``VLSI_OBJ_DIR=build-sky130-openroad`` gives the build directory a unique name to allow running multiple flows in the same repo. Note that for the rest of the tutorial we will still refer to this directory in file paths as ``build``, again for brevity.
|
||||
* ``VLSI_TOP`` is by default ``ChipTop``, which is the name of the top-level Verilog module generated in the Chipyard SoC configs. By instead setting ``VLSI_TOP=Rocket``, we can use the Rocket core as the top-level module for the VLSI flow, which consists only of a single RISC-V core (and no caches, peripherals, buses, etc). This is useful to run through this tutorial quickly, and does not rely on any SRAMs.
|
||||
* ``ENABLE_YOSYS_FLOW = 1`` is required for synthesis through Yosys. This reverts to the Scala FIRRTL Compiler so that unsupported multidimensional arrays are not generated in the Verilog.
|
||||
|
||||
Running the VLSI Flow
|
||||
---------------------
|
||||
|
||||
@@ -57,11 +57,26 @@ ifeq ($(SUB_PROJECT),bringup)
|
||||
BOARD ?= vcu118
|
||||
FPGA_BRAND ?= xilinx
|
||||
endif
|
||||
ifeq ($(SUB_PROJECT),arty)
|
||||
|
||||
ifeq ($(SUB_PROJECT),nexysvideo)
|
||||
SBT_PROJECT ?= fpga_platforms
|
||||
MODEL ?= NexysVideoHarness
|
||||
VLOG_MODEL ?= NexysVideoHarness
|
||||
MODEL_PACKAGE ?= chipyard.fpga.nexysvideo
|
||||
CONFIG ?= RocketNexysVideoConfig
|
||||
CONFIG_PACKAGE ?= chipyard.fpga.nexysvideo
|
||||
GENERATOR_PACKAGE ?= chipyard
|
||||
TB ?= none # unused
|
||||
TOP ?= ChipTop
|
||||
BOARD ?= nexys_video
|
||||
FPGA_BRAND ?= xilinx
|
||||
endif
|
||||
|
||||
ifeq ($(SUB_PROJECT),arty35t)
|
||||
# TODO: Fix with Arty
|
||||
SBT_PROJECT ?= fpga_platforms
|
||||
MODEL ?= ArtyFPGATestHarness
|
||||
VLOG_MODEL ?= ArtyFPGATestHarness
|
||||
MODEL ?= Arty35THarness
|
||||
VLOG_MODEL ?= Arty35THarness
|
||||
MODEL_PACKAGE ?= chipyard.fpga.arty
|
||||
CONFIG ?= TinyRocketArtyConfig
|
||||
CONFIG_PACKAGE ?= chipyard.fpga.arty
|
||||
@@ -122,7 +137,7 @@ include $(base_dir)/common.mk
|
||||
# copy from other directory
|
||||
#########################################################################################
|
||||
all_vsrcs := \
|
||||
$(base_dir)/generators/sifive-blocks/vsrc/SRLatch.v
|
||||
$(base_dir)/generators/rocket-chip-blocks/vsrc/SRLatch.v
|
||||
|
||||
#########################################################################################
|
||||
# vivado rules
|
||||
|
||||
BIN
fpga/bootrom.rv32.img
Executable file
BIN
fpga/bootrom.rv32.img
Executable file
Binary file not shown.
BIN
fpga/bootrom.rv64.img
Executable file
BIN
fpga/bootrom.rv64.img
Executable file
Binary file not shown.
Submodule fpga/fpga-shells updated: 7d0b79f855...93004b7bd0
@@ -22,7 +22,16 @@
|
||||
#error Must define TL_CLK
|
||||
#endif
|
||||
|
||||
#define F_CLK TL_CLK
|
||||
#define F_CLK (TL_CLK)
|
||||
|
||||
// SPI SCLK frequency, in kHz
|
||||
// We are using the 25MHz High Speed mode. If this speed is not supported by the
|
||||
// SD card, consider changing to the Default Speed mode (12.5 MHz).
|
||||
#define SPI_CLK 25000
|
||||
|
||||
// SPI clock divisor value
|
||||
// @see https://ucb-bar.gitbook.io/baremetal-ide/baremetal-ide/using-peripheral-devices/sifive-ips/serial-peripheral-interface-spi
|
||||
#define SPI_DIV (((F_CLK * 1000) / SPI_CLK) / 2 - 1)
|
||||
|
||||
static volatile uint32_t * const spi = (void *)(SPI_CTRL_ADDR);
|
||||
|
||||
@@ -79,7 +88,9 @@ static inline void sd_cmd_end(void)
|
||||
static void sd_poweron(void)
|
||||
{
|
||||
long i;
|
||||
REG32(spi, SPI_REG_SCKDIV) = (F_CLK / 300000UL);
|
||||
// HACK: frequency change
|
||||
|
||||
REG32(spi, SPI_REG_SCKDIV) = SPI_DIV;
|
||||
REG32(spi, SPI_REG_CSMODE) = SPI_CSMODE_OFF;
|
||||
for (i = 10; i > 0; i--) {
|
||||
sd_dummy();
|
||||
@@ -171,12 +182,10 @@ static int copy(void)
|
||||
|
||||
dputs("CMD18");
|
||||
|
||||
kprintf("LOADING 0x%xB PAYLOAD\r\n", PAYLOAD_SIZE_B);
|
||||
kprintf("LOADING 0x%x B PAYLOAD\r\n", PAYLOAD_SIZE_B);
|
||||
kprintf("LOADING ");
|
||||
|
||||
// TODO: Speed up SPI freq. (breaks between these two values)
|
||||
//REG32(spi, SPI_REG_SCKDIV) = (F_CLK / 16666666UL);
|
||||
REG32(spi, SPI_REG_SCKDIV) = (F_CLK / 5000000UL);
|
||||
REG32(spi, SPI_REG_SCKDIV) = SPI_DIV;
|
||||
if (sd_cmd(0x52, BBL_PARTITION_START_SECTOR, 0xE1) != 0x00) {
|
||||
sd_cmd_end();
|
||||
return 1;
|
||||
|
||||
@@ -11,13 +11,14 @@ import freechips.rocketchip.tile._
|
||||
|
||||
import sifive.blocks.devices.uart._
|
||||
|
||||
import testchipip.{SerialTLKey}
|
||||
import testchipip.serdes.{SerialTLKey}
|
||||
|
||||
import chipyard.{BuildSystem}
|
||||
|
||||
// DOC include start: AbstractArty and Rocket
|
||||
class WithArtyTweaks extends Config(
|
||||
new WithArtyResetHarnessBinder ++
|
||||
new WithArtyDebugResetHarnessBinder ++
|
||||
new WithArtyJTAGResetHarnessBinder ++
|
||||
new WithArtyJTAGHarnessBinder ++
|
||||
new WithArtyUARTHarnessBinder ++
|
||||
new WithDebugResetPassthrough ++
|
||||
@@ -26,8 +27,12 @@ class WithArtyTweaks extends Config(
|
||||
new chipyard.harness.WithAllClocksFromHarnessClockInstantiator ++
|
||||
new chipyard.config.WithDTSTimebase(32000) ++
|
||||
new chipyard.config.WithSystemBusFrequency(32) ++
|
||||
new chipyard.config.WithFrontBusFrequency(32) ++
|
||||
new chipyard.config.WithControlBusFrequency(32) ++
|
||||
new chipyard.config.WithPeripheryBusFrequency(32) ++
|
||||
new testchipip.WithNoSerialTL
|
||||
new chipyard.config.WithControlBusFrequency(32) ++
|
||||
new testchipip.serdes.WithNoSerialTL ++
|
||||
new testchipip.soc.WithNoScratchpads
|
||||
)
|
||||
|
||||
class TinyRocketArtyConfig extends Config(
|
||||
|
||||
@@ -11,33 +11,29 @@ import sifive.blocks.devices.pinctrl.{BasePin}
|
||||
|
||||
import sifive.fpgashells.ip.xilinx.{IBUFG, IOBUF, PULLUP, PowerOnResetFPGAOnly}
|
||||
|
||||
import chipyard.harness.{ComposeHarnessBinder, OverrideHarnessBinder}
|
||||
import chipyard.iobinders.JTAGChipIO
|
||||
import chipyard.harness.{HarnessBinder}
|
||||
import chipyard.iobinders._
|
||||
|
||||
class WithArtyResetHarnessBinder extends ComposeHarnessBinder({
|
||||
(system: HasPeripheryDebug, th: ArtyFPGATestHarness, ports: Seq[Data]) => {
|
||||
val resetPorts = ports.collect { case b: Bool => b }
|
||||
require(resetPorts.size == 2)
|
||||
withClockAndReset(th.clock_32MHz, th.ck_rst) {
|
||||
// Debug module reset
|
||||
th.dut_ndreset := resetPorts(0)
|
||||
|
||||
// JTAG reset
|
||||
resetPorts(1) := PowerOnResetFPGAOnly(th.clock_32MHz)
|
||||
}
|
||||
class WithArtyDebugResetHarnessBinder extends HarnessBinder({
|
||||
case (th: Arty35THarness, port: DebugResetPort, chipId: Int) => {
|
||||
th.dut_ndreset := port.io // Debug module reset
|
||||
}
|
||||
})
|
||||
|
||||
class WithArtyJTAGHarnessBinder extends OverrideHarnessBinder({
|
||||
(system: HasPeripheryDebug, th: ArtyFPGATestHarness, ports: Seq[Data]) => {
|
||||
ports.map {
|
||||
case j: JTAGChipIO => {
|
||||
class WithArtyJTAGResetHarnessBinder extends HarnessBinder({
|
||||
case (th: Arty35THarness, port: JTAGResetPort, chipId: Int) => {
|
||||
port.io := PowerOnResetFPGAOnly(th.clock_32MHz) // JTAG module reset
|
||||
}
|
||||
})
|
||||
|
||||
class WithArtyJTAGHarnessBinder extends HarnessBinder({
|
||||
case (th: Arty35THarness, port: JTAGPort, chipId: Int) => {
|
||||
val jtag_wire = Wire(new JTAGIO)
|
||||
jtag_wire.TDO.data := j.TDO
|
||||
jtag_wire.TDO.data := port.io.TDO
|
||||
jtag_wire.TDO.driven := true.B
|
||||
j.TCK := jtag_wire.TCK
|
||||
j.TMS := jtag_wire.TMS
|
||||
j.TDI := jtag_wire.TDI
|
||||
port.io.TCK := jtag_wire.TCK
|
||||
port.io.TMS := jtag_wire.TMS
|
||||
port.io.TDI := jtag_wire.TDI
|
||||
|
||||
val io_jtag = Wire(new JTAGPins(() => new BasePin(), false)).suggestName("jtag")
|
||||
|
||||
@@ -63,16 +59,13 @@ class WithArtyJTAGHarnessBinder extends OverrideHarnessBinder({
|
||||
io_jtag.TMS.i.po.map(_ := DontCare)
|
||||
io_jtag.TDO.i.po.map(_ := DontCare)
|
||||
}
|
||||
case b: Bool =>
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
class WithArtyUARTHarnessBinder extends OverrideHarnessBinder({
|
||||
(system: HasPeripheryUARTModuleImp, th: ArtyFPGATestHarness, ports: Seq[UARTPortIO]) => {
|
||||
class WithArtyUARTHarnessBinder extends HarnessBinder({
|
||||
case (th: Arty35THarness, port: UARTPort, chipId: Int) => {
|
||||
withClockAndReset(th.clock_32MHz, th.ck_rst) {
|
||||
IOBUF(th.uart_rxd_out, ports.head.txd)
|
||||
ports.head.rxd := IOBUF(th.uart_txd_in)
|
||||
IOBUF(th.uart_rxd_out, port.io.txd)
|
||||
port.io.rxd := IOBUF(th.uart_txd_in)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -5,7 +5,7 @@ import chisel3.experimental.{IO}
|
||||
|
||||
import freechips.rocketchip.devices.debug.{HasPeripheryDebug}
|
||||
|
||||
import chipyard.iobinders.{ComposeIOBinder}
|
||||
import chipyard.iobinders.{ComposeIOBinder, DebugResetPort, JTAGResetPort}
|
||||
|
||||
class WithDebugResetPassthrough extends ComposeIOBinder({
|
||||
(system: HasPeripheryDebug) => {
|
||||
@@ -18,6 +18,6 @@ class WithDebugResetPassthrough extends ComposeIOBinder({
|
||||
val io_sjtag_reset: Bool = IO(Input(Bool())).suggestName("sjtag_reset")
|
||||
sjtag.reset := io_sjtag_reset
|
||||
|
||||
(Seq(io_ndreset, io_sjtag_reset), Nil)
|
||||
(Seq(DebugResetPort(() => io_ndreset), JTAGResetPort(() => io_sjtag_reset)), Nil)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -9,9 +9,8 @@ import org.chipsalliance.cde.config.{Parameters}
|
||||
import sifive.fpgashells.shell.xilinx.artyshell.{ArtyShell}
|
||||
|
||||
import chipyard.harness.{HasHarnessInstantiators}
|
||||
import chipyard.iobinders.{HasIOBinders}
|
||||
|
||||
class ArtyFPGATestHarness(override implicit val p: Parameters) extends ArtyShell with HasHarnessInstantiators {
|
||||
class Arty35THarness(override implicit val p: Parameters) extends ArtyShell with HasHarnessInstantiators {
|
||||
// Convert harness resets from Bool to Reset type.
|
||||
val hReset = Wire(Reset())
|
||||
hReset := ~ck_rst
|
||||
|
||||
@@ -12,30 +12,34 @@ import freechips.rocketchip.tile._
|
||||
import sifive.blocks.devices.uart._
|
||||
import sifive.fpgashells.shell.{DesignKey}
|
||||
|
||||
import testchipip.{SerialTLKey}
|
||||
import testchipip.serdes.{SerialTLKey}
|
||||
|
||||
import chipyard.{BuildSystem}
|
||||
|
||||
// don't use FPGAShell's DesignKey
|
||||
class WithNoDesignKey extends Config((site, here, up) => {
|
||||
case DesignKey => (p: Parameters) => new SimpleLazyModule()(p)
|
||||
case DesignKey => (p: Parameters) => new SimpleLazyRawModule()(p)
|
||||
})
|
||||
|
||||
class WithArty100TTweaks extends Config(
|
||||
// By default, this uses the on-board USB-UART for the TSI-over-UART link
|
||||
// The PMODUART HarnessBinder maps the actual UART device to JD pin
|
||||
class WithArty100TTweaks(freqMHz: Double = 50) extends Config(
|
||||
new WithArty100TPMODUART ++
|
||||
new WithArty100TUARTTSI ++
|
||||
new WithArty100TDDRTL ++
|
||||
new WithArty100TJTAG ++
|
||||
new WithNoDesignKey ++
|
||||
new testchipip.WithUARTTSIClient ++
|
||||
new testchipip.tsi.WithUARTTSIClient ++
|
||||
new chipyard.harness.WithSerialTLTiedOff ++
|
||||
new chipyard.harness.WithHarnessBinderClockFreqMHz(50) ++
|
||||
new chipyard.config.WithMemoryBusFrequency(50.0) ++
|
||||
new chipyard.config.WithFrontBusFrequency(50.0) ++
|
||||
new chipyard.config.WithSystemBusFrequency(50.0) ++
|
||||
new chipyard.config.WithPeripheryBusFrequency(50.0) ++
|
||||
new chipyard.harness.WithHarnessBinderClockFreqMHz(freqMHz) ++
|
||||
new chipyard.config.WithMemoryBusFrequency(freqMHz) ++
|
||||
new chipyard.config.WithFrontBusFrequency(freqMHz) ++
|
||||
new chipyard.config.WithSystemBusFrequency(freqMHz) ++
|
||||
new chipyard.config.WithPeripheryBusFrequency(freqMHz) ++
|
||||
new chipyard.config.WithControlBusFrequency(freqMHz) ++
|
||||
new chipyard.config.WithOffchipBusFrequency(freqMHz) ++
|
||||
new chipyard.harness.WithAllClocksFromHarnessClockInstantiator ++
|
||||
new chipyard.clocking.WithPassthroughClockGenerator ++
|
||||
new chipyard.config.WithNoDebug ++ // no jtag
|
||||
new chipyard.config.WithNoUART ++ // use UART for the UART-TSI thing instad
|
||||
new chipyard.config.WithTLBackingMemory ++ // FPGA-shells converts the AXI to TL for us
|
||||
new freechips.rocketchip.subsystem.WithExtMemSize(BigInt(256) << 20) ++ // 256mb on ARTY
|
||||
new freechips.rocketchip.subsystem.WithoutTLMonitors)
|
||||
@@ -45,22 +49,14 @@ class RocketArty100TConfig extends Config(
|
||||
new chipyard.config.WithBroadcastManager ++ // no l2
|
||||
new chipyard.RocketConfig)
|
||||
|
||||
class UART230400RocketArty100TConfig extends Config(
|
||||
new WithArty100TUARTTSI(uartBaudRate = 230400) ++
|
||||
new RocketArty100TConfig)
|
||||
|
||||
class UART460800RocketArty100TConfig extends Config(
|
||||
new WithArty100TUARTTSI(uartBaudRate = 460800) ++
|
||||
new RocketArty100TConfig)
|
||||
|
||||
class UART921600RocketArty100TConfig extends Config(
|
||||
new WithArty100TUARTTSI(uartBaudRate = 921600) ++
|
||||
new RocketArty100TConfig)
|
||||
|
||||
|
||||
class NoCoresArty100TConfig extends Config(
|
||||
new WithArty100TTweaks ++
|
||||
new chipyard.config.WithMemoryBusFrequency(50.0) ++
|
||||
new chipyard.config.WithPeripheryBusFrequency(50.0) ++ // Match the sbus and pbus frequency
|
||||
new chipyard.config.WithBroadcastManager ++ // no l2
|
||||
new chipyard.NoCoresConfig)
|
||||
|
||||
// This will fail to close timing above 50 MHz
|
||||
class BringupArty100TConfig extends Config(
|
||||
new WithArty100TSerialTLToGPIO ++
|
||||
new WithArty100TTweaks(freqMHz = 50) ++
|
||||
new testchipip.serdes.WithSerialTLPHYParams(testchipip.serdes.InternalSyncSerialParams(freqMHz=50)) ++
|
||||
new chipyard.ChipBringupHostConfig)
|
||||
|
||||
@@ -5,19 +5,18 @@ import chisel3.util._
|
||||
import freechips.rocketchip.diplomacy._
|
||||
import org.chipsalliance.cde.config.{Parameters}
|
||||
import freechips.rocketchip.tilelink._
|
||||
import freechips.rocketchip.prci.{ClockBundle, ClockBundleParameters}
|
||||
import freechips.rocketchip.prci._
|
||||
import freechips.rocketchip.subsystem.{SystemBusKey}
|
||||
|
||||
import sifive.fpgashells.shell.xilinx._
|
||||
import sifive.fpgashells.shell._
|
||||
import sifive.fpgashells.clocks.{ClockGroup, ClockSinkNode, PLLFactoryKey, ResetWrangler}
|
||||
import sifive.fpgashells.clocks._
|
||||
import sifive.fpgashells.ip.xilinx.{IBUF, PowerOnResetFPGAOnly}
|
||||
|
||||
import sifive.blocks.devices.uart._
|
||||
|
||||
import chipyard._
|
||||
import chipyard.harness._
|
||||
import chipyard.iobinders.{HasIOBinders}
|
||||
|
||||
class Arty100THarness(override implicit val p: Parameters) extends Arty100TShell {
|
||||
def dp = designParameters
|
||||
@@ -34,9 +33,6 @@ class Arty100THarness(override implicit val p: Parameters) extends Arty100TShell
|
||||
|
||||
harnessSysPLLNode := clockOverlay.overlayOutput.node
|
||||
|
||||
val io_uart_bb = BundleBridgeSource(() => new UARTPortIO(dp(PeripheryUARTKey).headOption.getOrElse(UARTParams(0))))
|
||||
val uartOverlay = dp(UARTOverlayKey).head.place(UARTDesignInput(io_uart_bb))
|
||||
|
||||
val ddrOverlay = dp(DDROverlayKey).head.place(DDRDesignInput(dp(ExtTLMem).get.master.base, dutWrangler.node, harnessSysPLLNode)).asInstanceOf[DDRArtyPlacedOverlay]
|
||||
val ddrClient = TLClientNode(Seq(TLMasterPortParameters.v1(Seq(TLMasterParameters.v1(
|
||||
name = "chip_ddr",
|
||||
@@ -80,6 +76,9 @@ class Arty100THarness(override implicit val p: Parameters) extends Arty100TShell
|
||||
def referenceReset = dutClock.in.head._1.reset
|
||||
def success = { require(false, "Unused"); false.B }
|
||||
|
||||
childClock := harnessBinderClock
|
||||
childReset := harnessBinderReset
|
||||
|
||||
ddrOverlay.mig.module.clock := harnessBinderClock
|
||||
ddrOverlay.mig.module.reset := harnessBinderReset
|
||||
ddrBlockDuringReset.module.clock := harnessBinderClock
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package chipyard.fpga.arty100t
|
||||
|
||||
import chisel3._
|
||||
import chisel3.experimental.{DataMirror, Direction}
|
||||
|
||||
import freechips.rocketchip.jtag.{JTAGIO}
|
||||
import freechips.rocketchip.subsystem.{PeripheryBusKey}
|
||||
@@ -11,38 +12,138 @@ import freechips.rocketchip.diplomacy.{LazyRawModuleImp}
|
||||
import sifive.blocks.devices.uart.{UARTPortIO, HasPeripheryUARTModuleImp, UARTParams}
|
||||
import sifive.blocks.devices.jtag.{JTAGPins, JTAGPinsFromPort}
|
||||
import sifive.blocks.devices.pinctrl.{BasePin}
|
||||
|
||||
import sifive.fpgashells.ip.xilinx.{IBUFG, IOBUF, PULLUP, PowerOnResetFPGAOnly}
|
||||
|
||||
import sifive.fpgashells.shell._
|
||||
import sifive.fpgashells.ip.xilinx._
|
||||
import sifive.fpgashells.shell.xilinx._
|
||||
import sifive.fpgashells.clocks._
|
||||
import chipyard._
|
||||
import chipyard.harness._
|
||||
import chipyard.iobinders.JTAGChipIO
|
||||
import chipyard.iobinders._
|
||||
import testchipip.serdes._
|
||||
|
||||
import testchipip._
|
||||
|
||||
class WithArty100TUARTTSI(uartBaudRate: BigInt = 115200) extends OverrideHarnessBinder({
|
||||
(system: CanHavePeripheryUARTTSI, th: HasHarnessInstantiators, ports: Seq[UARTTSIIO]) => {
|
||||
implicit val p = chipyard.iobinders.GetSystemParameters(system)
|
||||
require(ports.size <= 1)
|
||||
class WithArty100TUARTTSI extends HarnessBinder({
|
||||
case (th: HasHarnessInstantiators, port: UARTTSIPort, chipId: Int) => {
|
||||
val ath = th.asInstanceOf[LazyRawModuleImp].wrapper.asInstanceOf[Arty100THarness]
|
||||
ports.map({ port =>
|
||||
ath.io_uart_bb.bundle <> port.uart
|
||||
ath.other_leds(1) := port.dropped
|
||||
ath.other_leds(9) := port.tsi2tl_state(0)
|
||||
ath.other_leds(10) := port.tsi2tl_state(1)
|
||||
ath.other_leds(11) := port.tsi2tl_state(2)
|
||||
ath.other_leds(12) := port.tsi2tl_state(3)
|
||||
})
|
||||
val harnessIO = IO(new UARTPortIO(port.io.uartParams)).suggestName("uart_tsi")
|
||||
harnessIO <> port.io.uart
|
||||
val packagePinsWithPackageIOs = Seq(
|
||||
("A9" , IOPin(harnessIO.rxd)),
|
||||
("D10", IOPin(harnessIO.txd)))
|
||||
packagePinsWithPackageIOs foreach { case (pin, io) => {
|
||||
ath.xdc.addPackagePin(io, pin)
|
||||
ath.xdc.addIOStandard(io, "LVCMOS33")
|
||||
ath.xdc.addIOB(io)
|
||||
} }
|
||||
|
||||
ath.other_leds(1) := port.io.dropped
|
||||
ath.other_leds(9) := port.io.tsi2tl_state(0)
|
||||
ath.other_leds(10) := port.io.tsi2tl_state(1)
|
||||
ath.other_leds(11) := port.io.tsi2tl_state(2)
|
||||
ath.other_leds(12) := port.io.tsi2tl_state(3)
|
||||
}
|
||||
})
|
||||
|
||||
class WithArty100TDDRTL extends OverrideHarnessBinder({
|
||||
(system: CanHaveMasterTLMemPort, th: HasHarnessInstantiators, ports: Seq[HeterogeneousBag[TLBundle]]) => {
|
||||
require(ports.size == 1)
|
||||
|
||||
class WithArty100TDDRTL extends HarnessBinder({
|
||||
case (th: HasHarnessInstantiators, port: TLMemPort, chipId: Int) => {
|
||||
val artyTh = th.asInstanceOf[LazyRawModuleImp].wrapper.asInstanceOf[Arty100THarness]
|
||||
val bundles = artyTh.ddrClient.out.map(_._1)
|
||||
val ddrClientBundle = Wire(new HeterogeneousBag(bundles.map(_.cloneType)))
|
||||
bundles.zip(ddrClientBundle).foreach { case (bundle, io) => bundle <> io }
|
||||
ddrClientBundle <> ports.head
|
||||
ddrClientBundle <> port.io
|
||||
}
|
||||
})
|
||||
|
||||
// Uses PMOD JA/JB
|
||||
class WithArty100TSerialTLToGPIO extends HarnessBinder({
|
||||
case (th: HasHarnessInstantiators, port: SerialTLPort, chipId: Int) => {
|
||||
val artyTh = th.asInstanceOf[LazyRawModuleImp].wrapper.asInstanceOf[Arty100THarness]
|
||||
val harnessIO = IO(chiselTypeOf(port.io)).suggestName("serial_tl")
|
||||
harnessIO <> port.io
|
||||
|
||||
harnessIO match {
|
||||
case io: DecoupledSerialIO => {
|
||||
val clkIO = io match {
|
||||
case io: InternalSyncSerialIO => IOPin(io.clock_out)
|
||||
case io: ExternalSyncSerialIO => IOPin(io.clock_in)
|
||||
}
|
||||
val packagePinsWithPackageIOs = Seq(
|
||||
("G13", clkIO),
|
||||
("B11", IOPin(io.out.valid)),
|
||||
("A11", IOPin(io.out.ready)),
|
||||
("D12", IOPin(io.in.valid)),
|
||||
("D13", IOPin(io.in.ready)),
|
||||
("B18", IOPin(io.out.bits, 0)),
|
||||
("A18", IOPin(io.out.bits, 1)),
|
||||
("K16", IOPin(io.out.bits, 2)),
|
||||
("E15", IOPin(io.out.bits, 3)),
|
||||
("E16", IOPin(io.in.bits, 0)),
|
||||
("D15", IOPin(io.in.bits, 1)),
|
||||
("C15", IOPin(io.in.bits, 2)),
|
||||
("J17", IOPin(io.in.bits, 3))
|
||||
)
|
||||
packagePinsWithPackageIOs foreach { case (pin, io) => {
|
||||
artyTh.xdc.addPackagePin(io, pin)
|
||||
artyTh.xdc.addIOStandard(io, "LVCMOS33")
|
||||
}}
|
||||
|
||||
// Don't add IOB to the clock, if its an input
|
||||
io match {
|
||||
case io: InternalSyncSerialIO => packagePinsWithPackageIOs foreach { case (pin, io) => {
|
||||
artyTh.xdc.addIOB(io)
|
||||
}}
|
||||
case io: ExternalSyncSerialIO => packagePinsWithPackageIOs.drop(1).foreach { case (pin, io) => {
|
||||
artyTh.xdc.addIOB(io)
|
||||
}}
|
||||
}
|
||||
|
||||
artyTh.sdc.addClock("ser_tl_clock", clkIO, 100)
|
||||
artyTh.sdc.addGroup(pins = Seq(clkIO))
|
||||
artyTh.xdc.clockDedicatedRouteFalse(clkIO)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// Maps the UART device to the on-board USB-UART
|
||||
class WithArty100TUART(rxdPin: String = "A9", txdPin: String = "D10") extends HarnessBinder({
|
||||
case (th: HasHarnessInstantiators, port: UARTPort, chipId: Int) => {
|
||||
val ath = th.asInstanceOf[LazyRawModuleImp].wrapper.asInstanceOf[Arty100THarness]
|
||||
val harnessIO = IO(chiselTypeOf(port.io)).suggestName("uart")
|
||||
harnessIO <> port.io
|
||||
val packagePinsWithPackageIOs = Seq(
|
||||
(rxdPin, IOPin(harnessIO.rxd)),
|
||||
(txdPin, IOPin(harnessIO.txd)))
|
||||
packagePinsWithPackageIOs foreach { case (pin, io) => {
|
||||
ath.xdc.addPackagePin(io, pin)
|
||||
ath.xdc.addIOStandard(io, "LVCMOS33")
|
||||
ath.xdc.addIOB(io)
|
||||
} }
|
||||
}
|
||||
})
|
||||
|
||||
// Maps the UART device to PMOD JD pins 3/7
|
||||
class WithArty100TPMODUART extends WithArty100TUART("G2", "F3")
|
||||
|
||||
class WithArty100TJTAG extends HarnessBinder({
|
||||
case (th: HasHarnessInstantiators, port: JTAGPort, chipId: Int) => {
|
||||
val ath = th.asInstanceOf[LazyRawModuleImp].wrapper.asInstanceOf[Arty100THarness]
|
||||
val harnessIO = IO(chiselTypeOf(port.io)).suggestName("jtag")
|
||||
harnessIO <> port.io
|
||||
|
||||
ath.sdc.addClock("JTCK", IOPin(harnessIO.TCK), 10)
|
||||
ath.sdc.addGroup(clocks = Seq("JTCK"))
|
||||
ath.xdc.clockDedicatedRouteFalse(IOPin(harnessIO.TCK))
|
||||
val packagePinsWithPackageIOs = Seq(
|
||||
("F4", IOPin(harnessIO.TCK)),
|
||||
("D2", IOPin(harnessIO.TMS)),
|
||||
("E2", IOPin(harnessIO.TDI)),
|
||||
("D4", IOPin(harnessIO.TDO))
|
||||
)
|
||||
packagePinsWithPackageIOs foreach { case (pin, io) => {
|
||||
ath.xdc.addPackagePin(io, pin)
|
||||
ath.xdc.addIOStandard(io, "LVCMOS33")
|
||||
ath.xdc.addPullup(io)
|
||||
} }
|
||||
}
|
||||
})
|
||||
|
||||
74
fpga/src/main/scala/nexysvideo/Configs.scala
Normal file
74
fpga/src/main/scala/nexysvideo/Configs.scala
Normal file
@@ -0,0 +1,74 @@
|
||||
// See LICENSE for license details.
|
||||
package chipyard.fpga.nexysvideo
|
||||
|
||||
import org.chipsalliance.cde.config._
|
||||
import freechips.rocketchip.subsystem._
|
||||
import freechips.rocketchip.devices.debug._
|
||||
import freechips.rocketchip.devices.tilelink._
|
||||
import freechips.rocketchip.diplomacy._
|
||||
import freechips.rocketchip.system._
|
||||
import freechips.rocketchip.tile._
|
||||
|
||||
import sifive.blocks.devices.uart._
|
||||
import sifive.fpgashells.shell.{DesignKey}
|
||||
|
||||
import testchipip.serdes.{SerialTLKey}
|
||||
|
||||
import chipyard.{BuildSystem}
|
||||
|
||||
// don't use FPGAShell's DesignKey
|
||||
class WithNoDesignKey extends Config((site, here, up) => {
|
||||
case DesignKey => (p: Parameters) => new SimpleLazyRawModule()(p)
|
||||
})
|
||||
|
||||
// DOC include start: WithNexysVideoTweaks and Rocket
|
||||
class WithNexysVideoTweaks extends Config(
|
||||
new WithNexysVideoUARTTSI ++
|
||||
new WithNexysVideoDDRTL ++
|
||||
new WithNoDesignKey ++
|
||||
new testchipip.tsi.WithUARTTSIClient ++
|
||||
new chipyard.harness.WithSerialTLTiedOff ++
|
||||
new chipyard.harness.WithHarnessBinderClockFreqMHz(50) ++
|
||||
new chipyard.config.WithMemoryBusFrequency(50.0) ++
|
||||
new chipyard.config.WithFrontBusFrequency(50.0) ++
|
||||
new chipyard.config.WithSystemBusFrequency(50.0) ++
|
||||
new chipyard.config.WithPeripheryBusFrequency(50.0) ++
|
||||
new chipyard.config.WithControlBusFrequency(50.0) ++
|
||||
new chipyard.harness.WithAllClocksFromHarnessClockInstantiator ++
|
||||
new chipyard.clocking.WithPassthroughClockGenerator ++
|
||||
new chipyard.config.WithNoDebug ++ // no jtag
|
||||
new chipyard.config.WithNoUART ++ // use UART for the UART-TSI thing instad
|
||||
new chipyard.config.WithTLBackingMemory ++ // FPGA-shells converts the AXI to TL for us
|
||||
new freechips.rocketchip.subsystem.WithExtMemSize(BigInt(512) << 20) ++ // 512mb on Nexys Video
|
||||
new freechips.rocketchip.subsystem.WithoutTLMonitors)
|
||||
|
||||
class RocketNexysVideoConfig extends Config(
|
||||
new WithNexysVideoTweaks ++
|
||||
new chipyard.config.WithBroadcastManager ++ // no l2
|
||||
new chipyard.RocketConfig)
|
||||
// DOC include end: WithNexysVideoTweaks and Rocket
|
||||
|
||||
// DOC include start: WithTinyNexysVideoTweaks and Rocket
|
||||
class WithTinyNexysVideoTweaks extends Config(
|
||||
new WithNexysVideoUARTTSI ++
|
||||
new WithNoDesignKey ++
|
||||
new sifive.fpgashells.shell.xilinx.WithNoNexysVideoShellDDR ++ // no DDR
|
||||
new testchipip.tsi.WithUARTTSIClient ++
|
||||
new chipyard.harness.WithSerialTLTiedOff ++
|
||||
new chipyard.harness.WithHarnessBinderClockFreqMHz(50) ++
|
||||
new chipyard.config.WithMemoryBusFrequency(50.0) ++
|
||||
new chipyard.config.WithFrontBusFrequency(50.0) ++
|
||||
new chipyard.config.WithSystemBusFrequency(50.0) ++
|
||||
new chipyard.config.WithPeripheryBusFrequency(50.0) ++
|
||||
new chipyard.config.WithControlBusFrequency(50.0) ++
|
||||
new chipyard.harness.WithAllClocksFromHarnessClockInstantiator ++
|
||||
new chipyard.clocking.WithPassthroughClockGenerator ++
|
||||
new chipyard.config.WithNoDebug ++ // no jtag
|
||||
new chipyard.config.WithNoUART ++ // use UART for the UART-TSI thing instad
|
||||
new freechips.rocketchip.subsystem.WithoutTLMonitors)
|
||||
|
||||
class TinyRocketNexysVideoConfig extends Config(
|
||||
new WithTinyNexysVideoTweaks ++
|
||||
new chipyard.config.WithBroadcastManager ++ // no l2
|
||||
new chipyard.TinyRocketConfig)
|
||||
// DOC include end: WithTinyNexysVideoTweaks and Rocket
|
||||
91
fpga/src/main/scala/nexysvideo/Harness.scala
Normal file
91
fpga/src/main/scala/nexysvideo/Harness.scala
Normal file
@@ -0,0 +1,91 @@
|
||||
// See LICENSE for license details.
|
||||
package chipyard.fpga.nexysvideo
|
||||
|
||||
import chisel3._
|
||||
import chisel3.util._
|
||||
import freechips.rocketchip.diplomacy._
|
||||
import org.chipsalliance.cde.config.{Parameters}
|
||||
import freechips.rocketchip.tilelink._
|
||||
import freechips.rocketchip.subsystem.{SystemBusKey}
|
||||
import freechips.rocketchip.prci._
|
||||
import sifive.fpgashells.shell.xilinx._
|
||||
import sifive.fpgashells.shell._
|
||||
import sifive.fpgashells.clocks._
|
||||
|
||||
import sifive.blocks.devices.uart._
|
||||
|
||||
import chipyard._
|
||||
import chipyard.harness._
|
||||
|
||||
class NexysVideoHarness(override implicit val p: Parameters) extends NexysVideoShell {
|
||||
def dp = designParameters
|
||||
|
||||
val clockOverlay = dp(ClockInputOverlayKey).map(_.place(ClockInputDesignInput())).head
|
||||
val harnessSysPLL = dp(PLLFactoryKey)
|
||||
val harnessSysPLLNode = harnessSysPLL()
|
||||
val dutFreqMHz = (dp(SystemBusKey).dtsFrequency.get / (1000 * 1000)).toInt
|
||||
val dutClock = ClockSinkNode(freqMHz = dutFreqMHz)
|
||||
println(s"NexysVideo FPGA Base Clock Freq: ${dutFreqMHz} MHz")
|
||||
val dutWrangler = LazyModule(new ResetWrangler())
|
||||
val dutGroup = ClockGroup()
|
||||
dutClock := dutWrangler.node := dutGroup := harnessSysPLLNode
|
||||
|
||||
harnessSysPLLNode := clockOverlay.overlayOutput.node
|
||||
|
||||
val io_uart_bb = BundleBridgeSource(() => new UARTPortIO(dp(PeripheryUARTKey).headOption.getOrElse(UARTParams(0))))
|
||||
val uartOverlay = dp(UARTOverlayKey).head.place(UARTDesignInput(io_uart_bb))
|
||||
|
||||
// Optional DDR
|
||||
val ddrOverlay = if (p(NexysVideoShellDDR)) Some(dp(DDROverlayKey).head.place(DDRDesignInput(dp(ExtTLMem).get.master.base, dutWrangler.node, harnessSysPLLNode)).asInstanceOf[DDRNexysVideoPlacedOverlay]) else None
|
||||
val ddrClient = if (p(NexysVideoShellDDR)) Some(TLClientNode(Seq(TLMasterPortParameters.v1(Seq(TLMasterParameters.v1(
|
||||
name = "chip_ddr",
|
||||
sourceId = IdRange(0, 1 << dp(ExtTLMem).get.master.idBits)
|
||||
)))))) else None
|
||||
val ddrBlockDuringReset = if (p(NexysVideoShellDDR)) Some(LazyModule(new TLBlockDuringReset(4))) else None
|
||||
if (p(NexysVideoShellDDR)) { ddrOverlay.get.overlayOutput.ddr := ddrBlockDuringReset.get.node := ddrClient.get }
|
||||
|
||||
val ledOverlays = dp(LEDOverlayKey).map(_.place(LEDDesignInput()))
|
||||
val all_leds = ledOverlays.map(_.overlayOutput.led)
|
||||
val status_leds = all_leds.take(2)
|
||||
val other_leds = all_leds.drop(2)
|
||||
|
||||
|
||||
override lazy val module = new HarnessLikeImpl
|
||||
|
||||
class HarnessLikeImpl extends Impl with HasHarnessInstantiators {
|
||||
all_leds.foreach(_ := DontCare)
|
||||
clockOverlay.overlayOutput.node.out(0)._1.reset := ~resetPin
|
||||
|
||||
val clk_100mhz = clockOverlay.overlayOutput.node.out.head._1.clock
|
||||
|
||||
// Blink the status LEDs for sanity
|
||||
withClockAndReset(clk_100mhz, dutClock.in.head._1.reset) {
|
||||
val period = (BigInt(100) << 20) / status_leds.size
|
||||
val counter = RegInit(0.U(log2Ceil(period).W))
|
||||
val on = RegInit(0.U(log2Ceil(status_leds.size).W))
|
||||
status_leds.zipWithIndex.map { case (o,s) => o := on === s.U }
|
||||
counter := Mux(counter === (period-1).U, 0.U, counter + 1.U)
|
||||
when (counter === 0.U) {
|
||||
on := Mux(on === (status_leds.size-1).U, 0.U, on + 1.U)
|
||||
}
|
||||
}
|
||||
|
||||
other_leds(0) := resetPin
|
||||
|
||||
harnessSysPLL.plls.foreach(_._1.getReset.get := pllReset)
|
||||
|
||||
def referenceClockFreqMHz = dutFreqMHz
|
||||
def referenceClock = dutClock.in.head._1.clock
|
||||
def referenceReset = dutClock.in.head._1.reset
|
||||
def success = { require(false, "Unused"); false.B }
|
||||
|
||||
if (p(NexysVideoShellDDR)) {
|
||||
ddrOverlay.get.mig.module.clock := harnessBinderClock
|
||||
ddrOverlay.get.mig.module.reset := harnessBinderReset
|
||||
ddrBlockDuringReset.get.module.clock := harnessBinderClock
|
||||
ddrBlockDuringReset.get.module.reset := harnessBinderReset.asBool || !ddrOverlay.get.mig.module.io.port.init_calib_complete
|
||||
}
|
||||
|
||||
instantiateChipTops()
|
||||
}
|
||||
}
|
||||
37
fpga/src/main/scala/nexysvideo/HarnessBinders.scala
Normal file
37
fpga/src/main/scala/nexysvideo/HarnessBinders.scala
Normal file
@@ -0,0 +1,37 @@
|
||||
// See LICENSE for license details.
|
||||
package chipyard.fpga.nexysvideo
|
||||
|
||||
import chisel3._
|
||||
|
||||
import freechips.rocketchip.subsystem.{PeripheryBusKey}
|
||||
import freechips.rocketchip.tilelink.{TLBundle}
|
||||
import freechips.rocketchip.util.{HeterogeneousBag}
|
||||
import freechips.rocketchip.diplomacy.{LazyRawModuleImp}
|
||||
|
||||
import sifive.blocks.devices.uart.{UARTParams}
|
||||
|
||||
import chipyard._
|
||||
import chipyard.harness._
|
||||
import chipyard.iobinders._
|
||||
|
||||
class WithNexysVideoUARTTSI(uartBaudRate: BigInt = 115200) extends HarnessBinder({
|
||||
case (th: HasHarnessInstantiators, port: UARTTSIPort, chipId: Int) => {
|
||||
val nexysvideoth = th.asInstanceOf[LazyRawModuleImp].wrapper.asInstanceOf[NexysVideoHarness]
|
||||
nexysvideoth.io_uart_bb.bundle <> port.io.uart
|
||||
nexysvideoth.other_leds(1) := port.io.dropped
|
||||
nexysvideoth.other_leds(2) := port.io.tsi2tl_state(0)
|
||||
nexysvideoth.other_leds(3) := port.io.tsi2tl_state(1)
|
||||
nexysvideoth.other_leds(4) := port.io.tsi2tl_state(2)
|
||||
nexysvideoth.other_leds(5) := port.io.tsi2tl_state(3)
|
||||
}
|
||||
})
|
||||
|
||||
class WithNexysVideoDDRTL extends HarnessBinder({
|
||||
case (th: HasHarnessInstantiators, port: TLMemPort, chipId: Int) => {
|
||||
val nexysTh = th.asInstanceOf[LazyRawModuleImp].wrapper.asInstanceOf[NexysVideoHarness]
|
||||
val bundles = nexysTh.ddrClient.get.out.map(_._1)
|
||||
val ddrClientBundle = Wire(new HeterogeneousBag(bundles.map(_.cloneType)))
|
||||
bundles.zip(ddrClientBundle).foreach { case (bundle, io) => bundle <> io }
|
||||
ddrClientBundle <> port.io
|
||||
}
|
||||
})
|
||||
@@ -15,7 +15,7 @@ import sifive.blocks.devices.uart.{PeripheryUARTKey, UARTParams}
|
||||
import sifive.fpgashells.shell.{DesignKey}
|
||||
import sifive.fpgashells.shell.xilinx.{VC7074GDDRSize}
|
||||
|
||||
import testchipip.{SerialTLKey}
|
||||
import testchipip.serdes.{SerialTLKey}
|
||||
|
||||
import chipyard.{BuildSystem, ExtTLMem}
|
||||
import chipyard.harness._
|
||||
@@ -35,7 +35,7 @@ class WithSystemModifications extends Config((site, here, up) => {
|
||||
p.copy(hang = 0x10000, contentFileName = s"./fpga/src/main/resources/vc707/sdboot/build/sdboot.bin")
|
||||
}
|
||||
case ExtMem => up(ExtMem, site).map(x => x.copy(master = x.master.copy(size = site(VC7074GDDRSize)))) // set extmem to DDR size (note the size)
|
||||
case SerialTLKey => None // remove serialized tl port
|
||||
case SerialTLKey => Nil // remove serialized tl port
|
||||
})
|
||||
|
||||
class WithVC707Tweaks extends Config (
|
||||
@@ -45,6 +45,8 @@ class WithVC707Tweaks extends Config (
|
||||
new chipyard.config.WithMemoryBusFrequency(50.0) ++
|
||||
new chipyard.config.WithSystemBusFrequency(50.0) ++
|
||||
new chipyard.config.WithPeripheryBusFrequency(50.0) ++
|
||||
new chipyard.config.WithControlBusFrequency(50.0) ++
|
||||
new chipyard.config.WithFrontBusFrequency(50.0) ++
|
||||
|
||||
new chipyard.harness.WithHarnessBinderClockFreqMHz(50) ++
|
||||
new WithFPGAFrequency(50) ++ // default 50MHz freq
|
||||
@@ -53,10 +55,6 @@ class WithVC707Tweaks extends Config (
|
||||
new WithVC707UARTHarnessBinder ++
|
||||
new WithVC707SPISDCardHarnessBinder ++
|
||||
new WithVC707DDRMemHarnessBinder ++
|
||||
// io binders
|
||||
new WithUARTIOPassthrough ++
|
||||
new WithSPIIOPassthrough ++
|
||||
new WithTLIOPassthrough ++
|
||||
// other configuration
|
||||
new WithDefaultPeripherals ++
|
||||
new chipyard.config.WithTLBackingMemory ++ // use TL backing memory
|
||||
@@ -78,8 +76,11 @@ class BoomVC707Config extends Config (
|
||||
)
|
||||
|
||||
class WithFPGAFrequency(fMHz: Double) extends Config (
|
||||
new chipyard.config.WithPeripheryBusFrequency(fMHz) ++ // assumes using PBUS as default freq.
|
||||
new chipyard.config.WithMemoryBusFrequency(fMHz)
|
||||
new chipyard.config.WithPeripheryBusFrequency(fMHz) ++
|
||||
new chipyard.config.WithMemoryBusFrequency(fMHz) ++
|
||||
new chipyard.config.WithSystemBusFrequency(fMHz) ++
|
||||
new chipyard.config.WithControlBusFrequency(fMHz) ++
|
||||
new chipyard.config.WithFrontBusFrequency(fMHz)
|
||||
)
|
||||
|
||||
class WithFPGAFreq25MHz extends WithFPGAFrequency(25)
|
||||
|
||||
@@ -11,36 +11,29 @@ import sifive.blocks.devices.spi.{HasPeripherySPI, SPIPortIO}
|
||||
import sifive.fpgashells.devices.xilinx.xilinxvc707pciex1.{HasSystemXilinxVC707PCIeX1ModuleImp, XilinxVC707PCIeX1IO}
|
||||
|
||||
import chipyard.{CanHaveMasterTLMemPort}
|
||||
import chipyard.harness.{OverrideHarnessBinder}
|
||||
import chipyard.harness.{HarnessBinder}
|
||||
import chipyard.iobinders._
|
||||
|
||||
/*** UART ***/
|
||||
class WithVC707UARTHarnessBinder extends OverrideHarnessBinder({
|
||||
(system: HasPeripheryUARTModuleImp, th: BaseModule, ports: Seq[UARTPortIO]) => {
|
||||
th match { case vc707th: VC707FPGATestHarnessImp => {
|
||||
vc707th.vc707Outer.io_uart_bb.bundle <> ports.head
|
||||
}}
|
||||
class WithVC707UARTHarnessBinder extends HarnessBinder({
|
||||
case (th: VC707FPGATestHarnessImp, port: UARTPort, chipId: Int) => {
|
||||
th.vc707Outer.io_uart_bb.bundle <> port.io
|
||||
}
|
||||
})
|
||||
|
||||
/*** SPI ***/
|
||||
class WithVC707SPISDCardHarnessBinder extends OverrideHarnessBinder({
|
||||
(system: HasPeripherySPI, th: BaseModule, ports: Seq[SPIPortIO]) => {
|
||||
th match { case vc707th: VC707FPGATestHarnessImp => {
|
||||
vc707th.vc707Outer.io_spi_bb.bundle <> ports.head
|
||||
}}
|
||||
class WithVC707SPISDCardHarnessBinder extends HarnessBinder({
|
||||
case (th: VC707FPGATestHarnessImp, port: SPIPort, chipId: Int) => {
|
||||
th.vc707Outer.io_spi_bb.bundle <> port.io
|
||||
}
|
||||
})
|
||||
|
||||
/*** Experimental DDR ***/
|
||||
class WithVC707DDRMemHarnessBinder extends OverrideHarnessBinder({
|
||||
(system: CanHaveMasterTLMemPort, th: BaseModule, ports: Seq[HeterogeneousBag[TLBundle]]) => {
|
||||
th match { case vc707th: VC707FPGATestHarnessImp => {
|
||||
require(ports.size == 1)
|
||||
|
||||
val bundles = vc707th.vc707Outer.ddrClient.out.map(_._1)
|
||||
class WithVC707DDRMemHarnessBinder extends HarnessBinder({
|
||||
case (th: VC707FPGATestHarnessImp, port: TLMemPort, chipId: Int) => {
|
||||
val bundles = th.vc707Outer.ddrClient.out.map(_._1)
|
||||
val ddrClientBundle = Wire(new HeterogeneousBag(bundles.map(_.cloneType)))
|
||||
bundles.zip(ddrClientBundle).foreach { case (bundle, io) => bundle <> io }
|
||||
ddrClientBundle <> ports.head
|
||||
}}
|
||||
ddrClientBundle <> port.io
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
package chipyard.fpga.vc707
|
||||
|
||||
import chisel3._
|
||||
import chisel3.experimental.{IO, DataMirror}
|
||||
|
||||
import freechips.rocketchip.diplomacy.{ResourceBinding, Resource, ResourceAddress, InModuleBody}
|
||||
import freechips.rocketchip.subsystem.{BaseSubsystem}
|
||||
import freechips.rocketchip.util.{HeterogeneousBag}
|
||||
import freechips.rocketchip.tilelink.{TLBundle}
|
||||
|
||||
import sifive.blocks.devices.uart.{HasPeripheryUARTModuleImp}
|
||||
import sifive.blocks.devices.spi.{HasPeripherySPI, HasPeripherySPIModuleImp, MMCDevice}
|
||||
import sifive.fpgashells.devices.xilinx.xilinxvc707pciex1.{HasSystemXilinxVC707PCIeX1ModuleImp}
|
||||
|
||||
import chipyard.{CanHaveMasterTLMemPort}
|
||||
import chipyard.iobinders.{OverrideIOBinder, OverrideLazyIOBinder}
|
||||
|
||||
class WithUARTIOPassthrough extends OverrideIOBinder({
|
||||
(system: HasPeripheryUARTModuleImp) => {
|
||||
val io_uart_pins_temp = system.uart.zipWithIndex.map { case (dio, i) => IO(dio.cloneType).suggestName(s"uart_$i") }
|
||||
(io_uart_pins_temp zip system.uart).map { case (io, sysio) =>
|
||||
io <> sysio
|
||||
}
|
||||
(io_uart_pins_temp, Nil)
|
||||
}
|
||||
})
|
||||
|
||||
class WithSPIIOPassthrough extends OverrideLazyIOBinder({
|
||||
(system: HasPeripherySPI) => {
|
||||
// attach resource to 1st SPI
|
||||
ResourceBinding {
|
||||
Resource(new MMCDevice(system.tlSpiNodes.head.device, 1), "reg").bind(ResourceAddress(0))
|
||||
}
|
||||
|
||||
InModuleBody {
|
||||
system.asInstanceOf[BaseSubsystem].module match { case system: HasPeripherySPIModuleImp => {
|
||||
val io_spi_pins_temp = system.spi.zipWithIndex.map { case (dio, i) => IO(dio.cloneType).suggestName(s"spi_$i") }
|
||||
(io_spi_pins_temp zip system.spi).map { case (io, sysio) =>
|
||||
io <> sysio
|
||||
}
|
||||
(io_spi_pins_temp, Nil)
|
||||
} }
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
class WithTLIOPassthrough extends OverrideIOBinder({
|
||||
(system: CanHaveMasterTLMemPort) => {
|
||||
val io_tl_mem_pins_temp = IO(DataMirror.internal.chiselTypeClone[HeterogeneousBag[TLBundle]](system.mem_tl)).suggestName("tl_slave")
|
||||
io_tl_mem_pins_temp <> system.mem_tl
|
||||
(Seq(io_tl_mem_pins_temp), Nil)
|
||||
}
|
||||
})
|
||||
@@ -7,18 +7,18 @@ import org.chipsalliance.cde.config.{Parameters}
|
||||
import freechips.rocketchip.tilelink._
|
||||
import freechips.rocketchip.subsystem.{SystemBusKey}
|
||||
import freechips.rocketchip.diplomacy.{IdRange, TransferSizes}
|
||||
import freechips.rocketchip.prci._
|
||||
|
||||
import sifive.fpgashells.shell.xilinx.{VC707Shell, UARTVC707ShellPlacer, PCIeVC707ShellPlacer, ChipLinkVC707PlacedOverlay}
|
||||
import sifive.fpgashells.ip.xilinx.{IBUF, PowerOnResetFPGAOnly}
|
||||
import sifive.fpgashells.shell._
|
||||
import sifive.fpgashells.clocks.{ClockGroup, ClockSinkNode, PLLFactoryKey, ResetWrangler}
|
||||
import sifive.fpgashells.clocks.{PLLFactoryKey}
|
||||
import sifive.fpgashells.devices.xilinx.xilinxvc707pciex1.{XilinxVC707PCIeX1IO}
|
||||
|
||||
import sifive.blocks.devices.uart.{PeripheryUARTKey, UARTPortIO}
|
||||
import sifive.blocks.devices.spi.{PeripherySPIKey, SPIPortIO}
|
||||
|
||||
import chipyard._
|
||||
import chipyard.iobinders.{HasIOBinders}
|
||||
import chipyard.harness._
|
||||
|
||||
class VC707FPGATestHarness(override implicit val p: Parameters) extends VC707Shell { outer =>
|
||||
@@ -88,6 +88,7 @@ class VC707FPGATestHarness(override implicit val p: Parameters) extends VC707She
|
||||
}
|
||||
|
||||
class VC707FPGATestHarnessImp(_outer: VC707FPGATestHarness) extends LazyRawModuleImp(_outer) with HasHarnessInstantiators {
|
||||
override def provideImplicitClockToLazyChildren = true
|
||||
val vc707Outer = _outer
|
||||
|
||||
val reset = IO(Input(Bool())).suggestName("reset")
|
||||
|
||||
@@ -15,7 +15,7 @@ import sifive.blocks.devices.uart.{PeripheryUARTKey, UARTParams}
|
||||
import sifive.fpgashells.shell.{DesignKey}
|
||||
import sifive.fpgashells.shell.xilinx.{VCU118ShellPMOD, VCU118DDRSize}
|
||||
|
||||
import testchipip.{SerialTLKey}
|
||||
import testchipip.serdes.{SerialTLKey}
|
||||
|
||||
import chipyard._
|
||||
import chipyard.harness._
|
||||
@@ -36,7 +36,7 @@ class WithSystemModifications extends Config((site, here, up) => {
|
||||
p.copy(hang = 0x10000, contentFileName = s"./fpga/src/main/resources/vcu118/sdboot/build/sdboot.bin")
|
||||
}
|
||||
case ExtMem => up(ExtMem, site).map(x => x.copy(master = x.master.copy(size = site(VCU118DDRSize)))) // set extmem to DDR size
|
||||
case SerialTLKey => None // remove serialized tl port
|
||||
case SerialTLKey => Nil // remove serialized tl port
|
||||
})
|
||||
|
||||
// DOC include start: AbstractVCU118 and Rocket
|
||||
@@ -46,15 +46,14 @@ class WithVCU118Tweaks extends Config(
|
||||
new chipyard.clocking.WithPassthroughClockGenerator ++
|
||||
new chipyard.config.WithMemoryBusFrequency(100) ++
|
||||
new chipyard.config.WithSystemBusFrequency(100) ++
|
||||
new chipyard.config.WithControlBusFrequency(100) ++
|
||||
new chipyard.config.WithPeripheryBusFrequency(100) ++
|
||||
new chipyard.config.WithControlBusFrequency(100) ++
|
||||
new WithFPGAFrequency(100) ++ // default 100MHz freq
|
||||
// harness binders
|
||||
new WithUART ++
|
||||
new WithSPISDCard ++
|
||||
new WithDDRMem ++
|
||||
// io binders
|
||||
new WithUARTIOPassthrough ++
|
||||
new WithSPIIOPassthrough ++
|
||||
// other configuration
|
||||
new WithDefaultPeripherals ++
|
||||
new chipyard.config.WithTLBackingMemory ++ // use TL backing memory
|
||||
@@ -79,7 +78,9 @@ class BoomVCU118Config extends Config(
|
||||
class WithFPGAFrequency(fMHz: Double) extends Config(
|
||||
new chipyard.harness.WithHarnessBinderClockFreqMHz(fMHz) ++
|
||||
new chipyard.config.WithSystemBusFrequency(fMHz) ++
|
||||
new chipyard.config.WithPeripheryBusFrequency(fMHz) ++ // assumes using PBUS as default freq.
|
||||
new chipyard.config.WithPeripheryBusFrequency(fMHz) ++
|
||||
new chipyard.config.WithControlBusFrequency(fMHz) ++
|
||||
new chipyard.config.WithFrontBusFrequency(fMHz) ++
|
||||
new chipyard.config.WithMemoryBusFrequency(fMHz)
|
||||
)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import chisel3._
|
||||
import freechips.rocketchip.diplomacy._
|
||||
import org.chipsalliance.cde.config.{Parameters, Field}
|
||||
import freechips.rocketchip.tilelink.{TLInwardNode, TLAsyncCrossingSink}
|
||||
|
||||
import freechips.rocketchip.prci._
|
||||
import sifive.fpgashells.shell._
|
||||
import sifive.fpgashells.ip.xilinx._
|
||||
import sifive.fpgashells.shell.xilinx._
|
||||
@@ -79,7 +79,7 @@ class DDR2VCU118PlacedOverlay(val shell: VCU118FPGATestHarness, name: String, va
|
||||
ui.reset := /*!port.mmcm_locked ||*/ port.c0_ddr4_ui_clk_sync_rst
|
||||
port.c0_sys_clk_i := sys.clock.asUInt
|
||||
port.sys_rst := sys.reset // pllReset
|
||||
port.c0_ddr4_aresetn := !ar.reset
|
||||
port.c0_ddr4_aresetn := !(ar.reset.asBool)
|
||||
|
||||
// This was just copied from the SiFive example, but it's hard to follow.
|
||||
// The pins are emitted in the following order:
|
||||
|
||||
@@ -11,35 +11,28 @@ import sifive.blocks.devices.spi.{HasPeripherySPI, SPIPortIO}
|
||||
|
||||
import chipyard._
|
||||
import chipyard.harness._
|
||||
import chipyard.iobinders._
|
||||
|
||||
/*** UART ***/
|
||||
class WithUART extends OverrideHarnessBinder({
|
||||
(system: HasPeripheryUARTModuleImp, th: BaseModule with HasHarnessInstantiators, ports: Seq[UARTPortIO]) => {
|
||||
th match { case vcu118th: VCU118FPGATestHarnessImp => {
|
||||
vcu118th.vcu118Outer.io_uart_bb.bundle <> ports.head
|
||||
} }
|
||||
class WithUART extends HarnessBinder({
|
||||
case (th: VCU118FPGATestHarnessImp, port: UARTPort, chipId: Int) => {
|
||||
th.vcu118Outer.io_uart_bb.bundle <> port.io
|
||||
}
|
||||
})
|
||||
|
||||
/*** SPI ***/
|
||||
class WithSPISDCard extends OverrideHarnessBinder({
|
||||
(system: HasPeripherySPI, th: BaseModule with HasHarnessInstantiators, ports: Seq[SPIPortIO]) => {
|
||||
th match { case vcu118th: VCU118FPGATestHarnessImp => {
|
||||
vcu118th.vcu118Outer.io_spi_bb.bundle <> ports.head
|
||||
} }
|
||||
class WithSPISDCard extends HarnessBinder({
|
||||
case (th: VCU118FPGATestHarnessImp, port: SPIPort, chipId: Int) => {
|
||||
th.vcu118Outer.io_spi_bb.bundle <> port.io
|
||||
}
|
||||
})
|
||||
|
||||
/*** Experimental DDR ***/
|
||||
class WithDDRMem extends OverrideHarnessBinder({
|
||||
(system: CanHaveMasterTLMemPort, th: BaseModule with HasHarnessInstantiators, ports: Seq[HeterogeneousBag[TLBundle]]) => {
|
||||
th match { case vcu118th: VCU118FPGATestHarnessImp => {
|
||||
require(ports.size == 1)
|
||||
|
||||
val bundles = vcu118th.vcu118Outer.ddrClient.out.map(_._1)
|
||||
class WithDDRMem extends HarnessBinder({
|
||||
case (th: VCU118FPGATestHarnessImp, port: TLMemPort, chipId: Int) => {
|
||||
val bundles = th.vcu118Outer.ddrClient.out.map(_._1)
|
||||
val ddrClientBundle = Wire(new HeterogeneousBag(bundles.map(_.cloneType)))
|
||||
bundles.zip(ddrClientBundle).foreach { case (bundle, io) => bundle <> io }
|
||||
ddrClientBundle <> ports.head
|
||||
} }
|
||||
ddrClientBundle <> port.io
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
package chipyard.fpga.vcu118
|
||||
|
||||
import chisel3._
|
||||
import chisel3.experimental.{IO, DataMirror}
|
||||
|
||||
import freechips.rocketchip.diplomacy.{ResourceBinding, Resource, ResourceAddress, InModuleBody}
|
||||
import freechips.rocketchip.subsystem.{BaseSubsystem}
|
||||
import freechips.rocketchip.util.{HeterogeneousBag}
|
||||
import freechips.rocketchip.tilelink.{TLBundle}
|
||||
|
||||
import sifive.blocks.devices.uart.{HasPeripheryUARTModuleImp}
|
||||
import sifive.blocks.devices.spi.{HasPeripherySPI, HasPeripherySPIModuleImp, MMCDevice}
|
||||
|
||||
import chipyard.{CanHaveMasterTLMemPort}
|
||||
import chipyard.iobinders.{OverrideIOBinder, OverrideLazyIOBinder}
|
||||
|
||||
class WithUARTIOPassthrough extends OverrideIOBinder({
|
||||
(system: HasPeripheryUARTModuleImp) => {
|
||||
val io_uart_pins_temp = system.uart.zipWithIndex.map { case (dio, i) => IO(dio.cloneType).suggestName(s"uart_$i") }
|
||||
(io_uart_pins_temp zip system.uart).map { case (io, sysio) =>
|
||||
io <> sysio
|
||||
}
|
||||
(io_uart_pins_temp, Nil)
|
||||
}
|
||||
})
|
||||
|
||||
class WithSPIIOPassthrough extends OverrideLazyIOBinder({
|
||||
(system: HasPeripherySPI) => {
|
||||
// attach resource to 1st SPI
|
||||
ResourceBinding {
|
||||
Resource(new MMCDevice(system.tlSpiNodes.head.device, 1), "reg").bind(ResourceAddress(0))
|
||||
}
|
||||
|
||||
InModuleBody {
|
||||
system.asInstanceOf[BaseSubsystem].module match { case system: HasPeripherySPIModuleImp => {
|
||||
val io_spi_pins_temp = system.spi.zipWithIndex.map { case (dio, i) => IO(dio.cloneType).suggestName(s"spi_$i") }
|
||||
(io_spi_pins_temp zip system.spi).map { case (io, sysio) =>
|
||||
io <> sysio
|
||||
}
|
||||
(io_spi_pins_temp, Nil)
|
||||
} }
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -8,17 +8,16 @@ import org.chipsalliance.cde.config.{Parameters}
|
||||
import freechips.rocketchip.tilelink._
|
||||
import freechips.rocketchip.diplomacy.{IdRange, TransferSizes}
|
||||
import freechips.rocketchip.subsystem.{SystemBusKey}
|
||||
|
||||
import freechips.rocketchip.prci._
|
||||
import sifive.fpgashells.shell.xilinx._
|
||||
import sifive.fpgashells.ip.xilinx.{IBUF, PowerOnResetFPGAOnly}
|
||||
import sifive.fpgashells.shell._
|
||||
import sifive.fpgashells.clocks.{ClockGroup, ClockSinkNode, PLLFactoryKey, ResetWrangler}
|
||||
import sifive.fpgashells.clocks._
|
||||
|
||||
import sifive.blocks.devices.uart.{PeripheryUARTKey, UARTPortIO}
|
||||
import sifive.blocks.devices.spi.{PeripherySPIKey, SPIPortIO}
|
||||
|
||||
import chipyard._
|
||||
import chipyard.iobinders.{HasIOBinders}
|
||||
import chipyard.harness._
|
||||
|
||||
class VCU118FPGATestHarness(override implicit val p: Parameters) extends VCU118ShellBasicOverlays {
|
||||
@@ -91,6 +90,7 @@ class VCU118FPGATestHarness(override implicit val p: Parameters) extends VCU118S
|
||||
}
|
||||
|
||||
class VCU118FPGATestHarnessImp(_outer: VCU118FPGATestHarness) extends LazyRawModuleImp(_outer) with HasHarnessInstantiators {
|
||||
override def provideImplicitClockToLazyChildren = true
|
||||
val vcu118Outer = _outer
|
||||
|
||||
val reset = IO(Input(Bool())).suggestName("reset")
|
||||
|
||||
@@ -15,11 +15,12 @@ import sifive.blocks.devices.uart.{PeripheryUARTKey, UARTParams}
|
||||
import sifive.fpgashells.shell.{DesignKey}
|
||||
import sifive.fpgashells.shell.xilinx.{VCU118ShellPMOD, VCU118DDRSize}
|
||||
|
||||
import testchipip.{PeripheryTSIHostKey, TSIHostParams, TSIHostSerdesParams}
|
||||
import testchipip.tsi.{PeripheryTSIHostKey, TSIHostParams, TSIHostSerdesParams}
|
||||
|
||||
import chipyard.{BuildSystem}
|
||||
|
||||
import chipyard.fpga.vcu118.{WithVCU118Tweaks, WithFPGAFrequency, VCU118DDR2Size}
|
||||
import chipyard.iobinders.{WithGPIOPunchthrough}
|
||||
|
||||
class WithBringupPeripherals extends Config((site, here, up) => {
|
||||
case PeripheryUARTKey => up(PeripheryUARTKey, site) ++ List(UARTParams(address = BigInt(0x64003000L)))
|
||||
@@ -80,8 +81,7 @@ class WithBringupAdditions extends Config(
|
||||
new WithBringupGPIO ++
|
||||
new WithBringupTSIHost ++
|
||||
new WithTSITLIOPassthrough ++
|
||||
new WithI2CIOPassthrough ++
|
||||
new WithGPIOIOPassthrough ++
|
||||
new WithGPIOPunchthrough ++
|
||||
new WithBringupPeripherals ++
|
||||
new WithBringupVCU118System)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import sifive.fpgashells.shell.xilinx._
|
||||
import sifive.fpgashells.clocks._
|
||||
import sifive.fpgashells.devices.xilinx.xilinxvcu118mig.{XilinxVCU118MIGPads, XilinxVCU118MIGParams, XilinxVCU118MIG}
|
||||
|
||||
import testchipip.{TSIHostWidgetIO}
|
||||
import testchipip.tsi.{TSIHostWidgetIO}
|
||||
|
||||
import chipyard.fpga.vcu118.{FMCPMap}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import chipyard.{DigitalTop, DigitalTopModule}
|
||||
|
||||
class BringupVCU118DigitalTop(implicit p: Parameters) extends DigitalTop
|
||||
with sifive.blocks.devices.i2c.HasPeripheryI2C
|
||||
with testchipip.HasPeripheryTSIHostWidget
|
||||
with testchipip.tsi.HasPeripheryTSIHostWidget
|
||||
{
|
||||
override lazy val module = new BringupVCU118DigitalTopModule(this)
|
||||
}
|
||||
|
||||
@@ -11,59 +11,41 @@ import sifive.blocks.devices.spi.{HasPeripherySPI, SPIPortIO}
|
||||
import sifive.blocks.devices.i2c.{HasPeripheryI2CModuleImp, I2CPort}
|
||||
import sifive.blocks.devices.gpio.{HasPeripheryGPIOModuleImp, GPIOPortIO}
|
||||
|
||||
import testchipip.{HasPeripheryTSIHostWidget, TSIHostWidgetIO}
|
||||
import testchipip.tsi.{HasPeripheryTSIHostWidget, TSIHostWidgetIO}
|
||||
|
||||
import chipyard.harness._
|
||||
import chipyard.iobinders._
|
||||
|
||||
/*** UART ***/
|
||||
class WithBringupUART extends ComposeHarnessBinder({
|
||||
(system: HasPeripheryUARTModuleImp, th: BaseModule with HasHarnessInstantiators, ports: Seq[UARTPortIO]) => {
|
||||
th match { case vcu118th: BringupVCU118FPGATestHarnessImp => {
|
||||
require(ports.size == 2)
|
||||
|
||||
vcu118th.bringupOuter.io_fmc_uart_bb.bundle <> ports.last
|
||||
} }
|
||||
class WithBringupUART extends HarnessBinder({
|
||||
case (th: BringupVCU118FPGATestHarnessImp, port: UARTPort, chipId: Int) => {
|
||||
th.bringupOuter.io_fmc_uart_bb.bundle <> port.io
|
||||
}
|
||||
})
|
||||
|
||||
/*** I2C ***/
|
||||
class WithBringupI2C extends OverrideHarnessBinder({
|
||||
(system: HasPeripheryI2CModuleImp, th: BaseModule with HasHarnessInstantiators, ports: Seq[I2CPort]) => {
|
||||
th match { case vcu118th: BringupVCU118FPGATestHarnessImp => {
|
||||
require(ports.size == 1)
|
||||
|
||||
vcu118th.bringupOuter.io_i2c_bb.bundle <> ports.head
|
||||
} }
|
||||
class WithBringupI2C extends HarnessBinder({
|
||||
case (th: BringupVCU118FPGATestHarnessImp, port: chipyard.iobinders.I2CPort, chipId: Int) => {
|
||||
th.bringupOuter.io_i2c_bb.bundle <> port.io
|
||||
}
|
||||
})
|
||||
|
||||
/*** GPIO ***/
|
||||
class WithBringupGPIO extends OverrideHarnessBinder({
|
||||
(system: HasPeripheryGPIOModuleImp, th: BaseModule with HasHarnessInstantiators, ports: Seq[GPIOPortIO]) => {
|
||||
th match { case vcu118th: BringupVCU118FPGATestHarnessImp => {
|
||||
(vcu118th.bringupOuter.io_gpio_bb zip ports).map { case (bb_io, dut_io) =>
|
||||
bb_io.bundle <> dut_io
|
||||
}
|
||||
} }
|
||||
class WithBringupGPIO extends HarnessBinder({
|
||||
case (th: BringupVCU118FPGATestHarnessImp, port: GPIOPort, chipId: Int) => {
|
||||
th.bringupOuter.io_gpio_bb(port.pinId).bundle <> port.io
|
||||
}
|
||||
})
|
||||
|
||||
/*** TSI Host Widget ***/
|
||||
class WithBringupTSIHost extends OverrideHarnessBinder({
|
||||
(system: HasPeripheryTSIHostWidget, th: BaseModule with HasHarnessInstantiators, ports: Seq[Data]) => {
|
||||
th match { case vcu118th: BringupVCU118FPGATestHarnessImp => {
|
||||
require(ports.size == 2) // 1st goes to the TL mem, 2nd goes to the serial link
|
||||
|
||||
ports.head match { case tlPort: HeterogeneousBag[TLBundle] =>
|
||||
val tsiBundles = vcu118th.bringupOuter.tsiDdrClient.out.map(_._1)
|
||||
class WithBringupTSIHost extends HarnessBinder({
|
||||
case (th: BringupVCU118FPGATestHarnessImp, port: TLMemPort, chipId: Int) => {
|
||||
val tsiBundles = th.bringupOuter.tsiDdrClient.out.map(_._1)
|
||||
val tsiDdrClientBundle = Wire(new HeterogeneousBag(tsiBundles.map(_.cloneType)))
|
||||
tsiBundles.zip(tsiDdrClientBundle).foreach { case (bundle, io) => bundle <> io }
|
||||
tsiDdrClientBundle <> tlPort
|
||||
tsiDdrClientBundle <> port.io
|
||||
}
|
||||
|
||||
ports.last match { case serialPort: TSIHostWidgetIO =>
|
||||
vcu118th.bringupOuter.io_tsi_serial_bb.bundle <> serialPort
|
||||
}
|
||||
} }
|
||||
case (th: BringupVCU118FPGATestHarnessImp, port: TSIHostWidgetPort, chipId: Int) => {
|
||||
th.bringupOuter.io_tsi_serial_bb.bundle <> port.io
|
||||
}
|
||||
})
|
||||
|
||||
@@ -9,29 +9,12 @@ import freechips.rocketchip.tilelink.{TLBundle}
|
||||
import sifive.blocks.devices.gpio.{HasPeripheryGPIOModuleImp}
|
||||
import sifive.blocks.devices.i2c.{HasPeripheryI2CModuleImp}
|
||||
|
||||
import testchipip.{HasPeripheryTSIHostWidget, TSIHostWidgetIO}
|
||||
import testchipip.tsi.{HasPeripheryTSIHostWidget, TSIHostWidgetIO}
|
||||
|
||||
import chipyard.iobinders.{OverrideIOBinder}
|
||||
import chipyard.iobinders.{OverrideIOBinder, Port, TLMemPort}
|
||||
|
||||
class WithGPIOIOPassthrough extends OverrideIOBinder({
|
||||
(system: HasPeripheryGPIOModuleImp) => {
|
||||
val io_gpio_pins_temp = system.gpio.zipWithIndex.map { case (dio, i) => IO(dio.cloneType).suggestName(s"gpio_$i") }
|
||||
(io_gpio_pins_temp zip system.gpio).map { case (io, sysio) =>
|
||||
io <> sysio
|
||||
}
|
||||
(io_gpio_pins_temp, Nil)
|
||||
}
|
||||
})
|
||||
|
||||
class WithI2CIOPassthrough extends OverrideIOBinder({
|
||||
(system: HasPeripheryI2CModuleImp) => {
|
||||
val io_i2c_pins_temp = system.i2c.zipWithIndex.map { case (dio, i) => IO(dio.cloneType).suggestName(s"i2c_$i") }
|
||||
(io_i2c_pins_temp zip system.i2c).map { case (io, sysio) =>
|
||||
io <> sysio
|
||||
}
|
||||
(io_i2c_pins_temp, Nil)
|
||||
}
|
||||
})
|
||||
case class TSIHostWidgetPort(val getIO: () => TSIHostWidgetIO)
|
||||
extends Port[TSIHostWidgetIO]
|
||||
|
||||
class WithTSITLIOPassthrough extends OverrideIOBinder({
|
||||
(system: HasPeripheryTSIHostWidget) => {
|
||||
@@ -42,6 +25,6 @@ class WithTSITLIOPassthrough extends OverrideIOBinder({
|
||||
require(system.tsiSerial.size == 1)
|
||||
val io_tsi_serial_pins_temp = IO(DataMirror.internal.chiselTypeClone[TSIHostWidgetIO](system.tsiSerial.head)).suggestName("tsi_serial")
|
||||
io_tsi_serial_pins_temp <> system.tsiSerial.head
|
||||
(Seq(io_tsi_tl_mem_pins_temp, io_tsi_serial_pins_temp), Nil)
|
||||
(Seq(TLMemPort(() => io_tsi_tl_mem_pins_temp), TSIHostWidgetPort(() => io_tsi_serial_pins_temp)), Nil)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -5,7 +5,7 @@ import freechips.rocketchip.diplomacy._
|
||||
import org.chipsalliance.cde.config._
|
||||
import freechips.rocketchip.subsystem._
|
||||
import freechips.rocketchip.tilelink._
|
||||
|
||||
import freechips.rocketchip.prci._
|
||||
import sifive.fpgashells.shell.xilinx._
|
||||
import sifive.fpgashells.ip.xilinx._
|
||||
import sifive.fpgashells.shell._
|
||||
@@ -16,7 +16,8 @@ import sifive.blocks.devices.spi._
|
||||
import sifive.blocks.devices.i2c._
|
||||
import sifive.blocks.devices.gpio._
|
||||
|
||||
import testchipip.{HasPeripheryTSIHostWidget, PeripheryTSIHostKey, TSIHostWidgetIO, TLSinkSetter}
|
||||
import testchipip.tsi.{HasPeripheryTSIHostWidget, PeripheryTSIHostKey, TSIHostWidgetIO}
|
||||
import testchipip.util.{TLSinkSetter}
|
||||
|
||||
import chipyard.fpga.vcu118.{VCU118FPGATestHarness, VCU118FPGATestHarnessImp, DDR2VCU118ShellPlacer, SysClock2VCU118ShellPlacer}
|
||||
|
||||
|
||||
Submodule generators/bar-fetchers updated: a5bd985d29...12d1506f61
Submodule generators/boom updated: 96da674bc9...9459af0c1f
1
generators/caliptra-aes-acc
Submodule
1
generators/caliptra-aes-acc
Submodule
Submodule generators/caliptra-aes-acc added at 8bcd6b6bc1
@@ -12,7 +12,7 @@
|
||||
|
||||
#if __has_include("spiketile_tsi.h")
|
||||
#define SPIKETILE_HTIF_TSI
|
||||
extern htif_t* tsi;
|
||||
extern std::map<int, htif_t*> tsis;
|
||||
#endif
|
||||
#if __has_include("spiketile_dtm.h")
|
||||
#define SPIKETILE_HTIF_DTM
|
||||
@@ -346,8 +346,8 @@ extern "C" void spike_tile(int hartid, char* isa,
|
||||
chipyard_simif_t* simif = tile->simif;
|
||||
processor_t* proc = tile->proc;
|
||||
#if defined(SPIKETILE_HTIF_TSI)
|
||||
if (!simif->htif && tsi)
|
||||
simif->htif = tsi;
|
||||
if (!simif->htif && tsis.size() > 0 && tsis[0])
|
||||
simif->htif = tsis[0];
|
||||
#endif
|
||||
#if defined(SPIKETILE_HTIF_DTM)
|
||||
if (!simif->htif && dtm)
|
||||
@@ -447,18 +447,6 @@ chipyard_simif_t::chipyard_simif_t(size_t icache_ways,
|
||||
use_stq(false),
|
||||
htif(nullptr),
|
||||
fast_clint(false),
|
||||
cfg(std::make_pair(0, 0),
|
||||
nullptr,
|
||||
isastr,
|
||||
"MSU",
|
||||
"vlen:128,elen:64",
|
||||
false,
|
||||
endianness_little,
|
||||
pmpregions,
|
||||
std::vector<mem_cfg_t>(),
|
||||
std::vector<size_t>(),
|
||||
false,
|
||||
0),
|
||||
accessed_tofrom_host(false),
|
||||
icache_ways(icache_ways),
|
||||
icache_sets(icache_sets),
|
||||
@@ -470,6 +458,19 @@ chipyard_simif_t::chipyard_simif_t(size_t icache_ways,
|
||||
mmio_inflight(false)
|
||||
{
|
||||
|
||||
cfg.initrd_bounds = std::make_pair(0, 0);
|
||||
cfg.bootargs = nullptr;
|
||||
cfg.isa = isastr;
|
||||
cfg.priv = "MSU";
|
||||
cfg.varch = "vlen:128,elen:64";
|
||||
cfg.misaligned = false;
|
||||
cfg.endianness = endianness_little;
|
||||
cfg.pmpregions = pmpregions;
|
||||
cfg.mem_layout = std::vector<mem_cfg_t>();
|
||||
cfg.hartids = std::vector<size_t>();
|
||||
cfg.explicit_hartids = false;
|
||||
cfg.trigger_count = 0;
|
||||
|
||||
icache.resize(icache_ways);
|
||||
for (auto &w : icache) {
|
||||
w.resize(icache_sets);
|
||||
|
||||
@@ -5,10 +5,9 @@ import chisel3._
|
||||
import scala.collection.mutable.{ArrayBuffer}
|
||||
|
||||
import freechips.rocketchip.prci.{ClockGroupIdentityNode, ClockSinkParameters, ClockSinkNode, ClockGroup}
|
||||
import freechips.rocketchip.subsystem.{BaseSubsystem, SubsystemDriveAsyncClockGroupsKey}
|
||||
import org.chipsalliance.cde.config.{Parameters, Field}
|
||||
import freechips.rocketchip.diplomacy.{LazyModule, LazyModuleImp, LazyRawModuleImp, LazyModuleImpLike, BindingScope}
|
||||
import freechips.rocketchip.util.{ResetCatchAndSync}
|
||||
import freechips.rocketchip.util.{DontTouch}
|
||||
import chipyard.iobinders._
|
||||
|
||||
import barstools.iocell.chisel._
|
||||
@@ -31,5 +30,5 @@ class ChipTop(implicit p: Parameters) extends LazyModule with BindingScope
|
||||
// of ChipTop (ex: ClockGroup) do not receive clock or reset.
|
||||
// However. anonymous children of ChipTop should not need an implicit Clock or Reset
|
||||
// anyways, they probably need to be explicitly clocked.
|
||||
lazy val module: LazyModuleImpLike = new LazyRawModuleImp(this) { }
|
||||
lazy val module: LazyModuleImpLike = new LazyRawModuleImp(this) with DontTouch { }
|
||||
}
|
||||
|
||||
@@ -13,13 +13,14 @@ import freechips.rocketchip.devices.tilelink._
|
||||
|
||||
// DOC include start: DigitalTop
|
||||
class DigitalTop(implicit p: Parameters) extends ChipyardSystem
|
||||
with testchipip.CanHavePeripheryUARTTSI // Enables optional UART-based TSI transport
|
||||
with testchipip.CanHavePeripheryCustomBootPin // Enables optional custom boot pin
|
||||
with testchipip.CanHavePeripheryBootAddrReg // Use programmable boot address register
|
||||
with testchipip.CanHaveTraceIO // Enables optionally adding trace IO
|
||||
with testchipip.CanHaveBankedScratchpad // Enables optionally adding a banked scratchpad
|
||||
with testchipip.CanHavePeripheryBlockDevice // Enables optionally adding the block device
|
||||
with testchipip.CanHavePeripheryTLSerial // Enables optionally adding the backing memory and serial adapter
|
||||
with testchipip.tsi.CanHavePeripheryUARTTSI // Enables optional UART-based TSI transport
|
||||
with testchipip.boot.CanHavePeripheryCustomBootPin // Enables optional custom boot pin
|
||||
with testchipip.boot.CanHavePeripheryBootAddrReg // Use programmable boot address register
|
||||
with testchipip.cosim.CanHaveTraceIO // Enables optionally adding trace IO
|
||||
with testchipip.soc.CanHaveBankedScratchpad // Enables optionally adding a banked scratchpad
|
||||
with testchipip.iceblk.CanHavePeripheryBlockDevice // Enables optionally adding the block device
|
||||
with testchipip.serdes.CanHavePeripheryTLSerial // Enables optionally adding the backing memory and serial adapter
|
||||
with testchipip.soc.CanHavePeripheryChipIdPin // Enables optional pin to set chip id for multi-chip configs
|
||||
with sifive.blocks.devices.i2c.HasPeripheryI2C // Enables optionally adding the sifive I2C
|
||||
with sifive.blocks.devices.pwm.HasPeripheryPWM // Enables optionally adding the sifive PWM
|
||||
with sifive.blocks.devices.uart.HasPeripheryUART // Enables optionally adding the sifive UART
|
||||
@@ -39,6 +40,7 @@ class DigitalTop(implicit p: Parameters) extends ChipyardSystem
|
||||
with chipyard.example.CanHavePeripheryStreamingPassthrough // Enables optionally adding the DSPTools streaming-passthrough example widget
|
||||
with nvidia.blocks.dla.CanHavePeripheryNVDLA // Enables optionally having an NVDLA
|
||||
with chipyard.clocking.HasChipyardPRCI // Use Chipyard reset/clock distribution
|
||||
with chipyard.clocking.CanHaveClockTap // Enables optionally adding a clock tap output port
|
||||
with fftgenerator.CanHavePeripheryFFT // Enables optionally having an MMIO-based FFT block
|
||||
with constellation.soc.CanHaveGlobalNoC // Support instantiating a global NoC interconnect
|
||||
{
|
||||
@@ -46,7 +48,6 @@ class DigitalTop(implicit p: Parameters) extends ChipyardSystem
|
||||
}
|
||||
|
||||
class DigitalTopModule[+L <: DigitalTop](l: L) extends ChipyardSystemModule(l)
|
||||
with testchipip.CanHaveTraceIOModuleImp
|
||||
with sifive.blocks.devices.i2c.HasPeripheryI2CModuleImp
|
||||
with sifive.blocks.devices.pwm.HasPeripheryPWMModuleImp
|
||||
with sifive.blocks.devices.uart.HasPeripheryUARTModuleImp
|
||||
|
||||
@@ -2,7 +2,7 @@ package chipyard
|
||||
|
||||
import chisel3._
|
||||
import chisel3.util._
|
||||
import chisel3.experimental.{IntParam, StringParam, IO}
|
||||
import chisel3.experimental.{IntParam, StringParam}
|
||||
|
||||
import org.chipsalliance.cde.config._
|
||||
import freechips.rocketchip.subsystem._
|
||||
@@ -77,14 +77,15 @@ case class SpikeTileAttachParams(
|
||||
}
|
||||
|
||||
case class SpikeTileParams(
|
||||
hartId: Int = 0,
|
||||
tileId: Int = 0,
|
||||
val core: SpikeCoreParams = SpikeCoreParams(),
|
||||
icacheParams: ICacheParams = ICacheParams(nWays = 32),
|
||||
dcacheParams: DCacheParams = DCacheParams(nWays = 32),
|
||||
tcmParams: Option[MasterPortParams] = None // tightly coupled memory
|
||||
) extends InstantiableTileParams[SpikeTile]
|
||||
{
|
||||
val name = Some("spike_tile")
|
||||
val baseName = "spike_tile"
|
||||
val uniqueName = s"${baseName}_$tileId"
|
||||
val beuAddr = None
|
||||
val blockerCtrlAddr = None
|
||||
val btb = None
|
||||
@@ -92,7 +93,7 @@ case class SpikeTileParams(
|
||||
val dcache = Some(dcacheParams)
|
||||
val icache = Some(icacheParams)
|
||||
val clockSinkParams = ClockSinkParameters()
|
||||
def instantiate(crossing: TileCrossingParamsLike, lookup: LookupByHartIdImpl)(implicit p: Parameters): SpikeTile = {
|
||||
def instantiate(crossing: HierarchicalElementCrossingParamsLike, lookup: LookupByHartIdImpl)(implicit p: Parameters): SpikeTile = {
|
||||
new SpikeTile(this, crossing, lookup)
|
||||
}
|
||||
}
|
||||
@@ -106,11 +107,11 @@ class SpikeTile(
|
||||
with SourcesExternalNotifications
|
||||
{
|
||||
// Private constructor ensures altered LazyModule.p is used implicitly
|
||||
def this(params: SpikeTileParams, crossing: TileCrossingParamsLike, lookup: LookupByHartIdImpl)(implicit p: Parameters) =
|
||||
def this(params: SpikeTileParams, crossing: HierarchicalElementCrossingParamsLike, lookup: LookupByHartIdImpl)(implicit p: Parameters) =
|
||||
this(params, crossing.crossingType, lookup, p)
|
||||
|
||||
// Required TileLink nodes
|
||||
val intOutwardNode = IntIdentityNode()
|
||||
val intOutwardNode = None
|
||||
val masterNode = visibilityNode
|
||||
val slaveNode = TLIdentityNode()
|
||||
|
||||
@@ -129,21 +130,21 @@ class SpikeTile(
|
||||
}
|
||||
|
||||
ResourceBinding {
|
||||
Resource(cpuDevice, "reg").bind(ResourceAddress(hartId))
|
||||
Resource(cpuDevice, "reg").bind(ResourceAddress(tileId))
|
||||
}
|
||||
|
||||
|
||||
val icacheNode = TLClientNode(Seq(TLMasterPortParameters.v1(Seq(TLMasterParameters.v1(
|
||||
sourceId = IdRange(0, 1),
|
||||
name = s"Core ${staticIdForMetadataUseOnly} ICache")))))
|
||||
name = s"Core ${tileId} ICache")))))
|
||||
|
||||
val dcacheNode = TLClientNode(Seq(TLMasterPortParameters.v1(Seq(TLMasterParameters.v1(
|
||||
name = s"Core ${staticIdForMetadataUseOnly} DCache",
|
||||
name = s"Core ${tileId} DCache",
|
||||
sourceId = IdRange(0, tileParams.dcache.get.nMSHRs),
|
||||
supportsProbe = TransferSizes(p(CacheBlockBytes), p(CacheBlockBytes)))))))
|
||||
|
||||
val mmioNode = TLClientNode((Seq(TLMasterPortParameters.v1(Seq(TLMasterParameters.v1(
|
||||
name = s"Core ${staticIdForMetadataUseOnly} MMIO",
|
||||
name = s"Core ${tileId} MMIO",
|
||||
sourceId = IdRange(0, 1),
|
||||
requestFifo = true))))))
|
||||
|
||||
@@ -313,7 +314,7 @@ class SpikeBlackBox(
|
||||
}
|
||||
|
||||
class SpikeTileModuleImp(outer: SpikeTile) extends BaseTileModuleImp(outer) {
|
||||
|
||||
val tileParams = outer.tileParams
|
||||
// We create a bundle here and decode the interrupt.
|
||||
val int_bundle = Wire(new TileInterrupts())
|
||||
outer.decodeCoreInterrupts(int_bundle)
|
||||
@@ -337,7 +338,7 @@ class SpikeTileModuleImp(outer: SpikeTile) extends BaseTileModuleImp(outer) {
|
||||
// then the DTM-based bringup with SimDTM will be used. This isn't required to be
|
||||
// true, but it usually is
|
||||
val useDTM = p(ExportDebug).protocols.contains(DMI)
|
||||
val spike = Module(new SpikeBlackBox(hartId, isaDTS, tileParams.core.nPMPs,
|
||||
val spike = Module(new SpikeBlackBox(outer.tileId, outer.isaDTS, tileParams.core.nPMPs,
|
||||
tileParams.icache.get.nSets, tileParams.icache.get.nWays,
|
||||
tileParams.dcache.get.nSets, tileParams.dcache.get.nWays,
|
||||
tileParams.dcache.get.nMSHRs,
|
||||
@@ -467,19 +468,21 @@ class SpikeTileModuleImp(outer: SpikeTile) extends BaseTileModuleImp(outer) {
|
||||
}
|
||||
}
|
||||
|
||||
class WithNSpikeCores(n: Int = 1, tileParams: SpikeTileParams = SpikeTileParams(),
|
||||
overrideIdOffset: Option[Int] = None) extends Config((site, here, up) => {
|
||||
class WithNSpikeCores(n: Int = 1, tileParams: SpikeTileParams = SpikeTileParams()
|
||||
) extends Config((site, here, up) => {
|
||||
case TilesLocated(InSubsystem) => {
|
||||
// Calculate the next available hart ID (since hart ID cannot be duplicated)
|
||||
val prev = up(TilesLocated(InSubsystem), site)
|
||||
val idOffset = overrideIdOffset.getOrElse(prev.size)
|
||||
val idOffset = up(NumTiles)
|
||||
// Create TileAttachParams for every core to be instantiated
|
||||
(0 until n).map { i =>
|
||||
SpikeTileAttachParams(
|
||||
tileParams = tileParams.copy(hartId = i + idOffset)
|
||||
tileParams = tileParams.copy(tileId = i + idOffset)
|
||||
)
|
||||
} ++ prev
|
||||
}
|
||||
case NumTiles => up(NumTiles) + n
|
||||
|
||||
})
|
||||
|
||||
class WithSpikeTCM extends Config((site, here, up) => {
|
||||
@@ -492,5 +495,5 @@ class WithSpikeTCM extends Config((site, here, up) => {
|
||||
)))
|
||||
}
|
||||
case ExtMem => None
|
||||
case BankedL2Key => up(BankedL2Key).copy(nBanks = 0)
|
||||
case SubsystemBankedCoherenceKey => up(SubsystemBankedCoherenceKey).copy(nBanks = 0)
|
||||
})
|
||||
|
||||
@@ -24,12 +24,12 @@ import freechips.rocketchip.amba.axi4._
|
||||
import boom.common.{BoomTile}
|
||||
|
||||
|
||||
import testchipip.{CanHavePeripheryTLSerial, SerialTLKey}
|
||||
import testchipip.serdes.{CanHavePeripheryTLSerial, SerialTLKey}
|
||||
|
||||
trait CanHaveHTIF { this: BaseSubsystem =>
|
||||
// Advertise HTIF if system can communicate with fesvr
|
||||
if (this match {
|
||||
case _: CanHavePeripheryTLSerial if p(SerialTLKey).nonEmpty => true
|
||||
case _: CanHavePeripheryTLSerial if (p(SerialTLKey).size != 0) => true
|
||||
case _: HasPeripheryDebug if (!p(DebugModuleKey).isEmpty && p(ExportDebug).dmi) => true
|
||||
case _ => false
|
||||
}) {
|
||||
@@ -71,18 +71,24 @@ trait CanHaveChosenInDTS { this: BaseSubsystem =>
|
||||
}
|
||||
|
||||
class ChipyardSubsystem(implicit p: Parameters) extends BaseSubsystem
|
||||
with HasTiles
|
||||
with InstantiatesHierarchicalElements
|
||||
with HasTileNotificationSinks
|
||||
with HasTileInputConstants
|
||||
with CanHavePeripheryCLINT
|
||||
with CanHavePeripheryPLIC
|
||||
with HasPeripheryDebug
|
||||
with HasHierarchicalElementsRootContext
|
||||
with HasHierarchicalElements
|
||||
with CanHaveHTIF
|
||||
with CanHaveChosenInDTS
|
||||
{
|
||||
def coreMonitorBundles = tiles.map {
|
||||
def coreMonitorBundles = totalTiles.values.map {
|
||||
case r: RocketTile => r.module.core.rocketImpl.coreMonitorBundle
|
||||
case b: BoomTile => b.module.core.coreMonitorBundle
|
||||
}.toList
|
||||
|
||||
// No-tile configs have to be handled specially.
|
||||
if (tiles.size == 0) {
|
||||
if (totalTiles.size == 0) {
|
||||
// no PLIC, so sink interrupts to nowhere
|
||||
require(!p(PLICKey).isDefined)
|
||||
val intNexus = IntNexusNode(sourceFn = x => x.head, sinkFn = x => x.head)
|
||||
@@ -90,16 +96,12 @@ class ChipyardSubsystem(implicit p: Parameters) extends BaseSubsystem
|
||||
intSink := intNexus :=* ibus.toPLIC
|
||||
|
||||
// avoids a bug when there are no interrupt sources
|
||||
ibus.fromAsync := NullIntSource()
|
||||
ibus { ibus.fromAsync := NullIntSource() }
|
||||
|
||||
// Need to have at least 1 driver to the tile notification sinks
|
||||
tileHaltXbarNode := IntSourceNode(IntSourcePortSimple())
|
||||
tileWFIXbarNode := IntSourceNode(IntSourcePortSimple())
|
||||
tileCeaseXbarNode := IntSourceNode(IntSourcePortSimple())
|
||||
|
||||
// Sink reset vectors to nowhere
|
||||
val resetVectorSink = BundleBridgeSink[UInt](Some(() => UInt(28.W)))
|
||||
resetVectorSink := tileResetVectorNode
|
||||
}
|
||||
|
||||
// Relying on [[TLBusWrapperConnection]].driveClockFromMaster for
|
||||
@@ -107,7 +109,7 @@ class ChipyardSubsystem(implicit p: Parameters) extends BaseSubsystem
|
||||
// ClockGroup. This makes it impossible to determine which clocks are driven
|
||||
// by which bus based on the member names, which is problematic when there is
|
||||
// a rational crossing between two buses. Instead, provide all bus clocks
|
||||
// directly from the asyncClockGroupsNode in the subsystem to ensure bus
|
||||
// directly from the allClockGroupsNode in the subsystem to ensure bus
|
||||
// names are always preserved in the top-level clock names.
|
||||
//
|
||||
// For example, using a RationalCrossing between the Sbus and Cbus, and
|
||||
@@ -116,12 +118,12 @@ class ChipyardSubsystem(implicit p: Parameters) extends BaseSubsystem
|
||||
// Conversly, if an async crossing is used, they instead receive names of the
|
||||
// form "subsystem_cbus_[0-9]*". The assignment below provides the latter names in all cases.
|
||||
Seq(PBUS, FBUS, MBUS, CBUS).foreach { loc =>
|
||||
tlBusWrapperLocationMap.lift(loc).foreach { _.clockGroupNode := asyncClockGroupsNode }
|
||||
tlBusWrapperLocationMap.lift(loc).foreach { _.clockGroupNode := allClockGroupsNode }
|
||||
}
|
||||
override lazy val module = new ChipyardSubsystemModuleImp(this)
|
||||
}
|
||||
|
||||
class ChipyardSubsystemModuleImp[+L <: ChipyardSubsystem](_outer: L) extends BaseSubsystemModuleImp(_outer)
|
||||
with HasTilesModuleImp
|
||||
with HasHierarchicalElementsRootContextModuleImp
|
||||
{
|
||||
}
|
||||
|
||||
@@ -32,13 +32,6 @@ class ChipyardSystem(implicit p: Parameters) extends ChipyardSubsystem
|
||||
val bootROM = p(BootROMLocated(location)).map { BootROM.attach(_, this, CBUS) }
|
||||
val maskROMs = p(MaskROMLocated(location)).map { MaskROM.attach(_, this, CBUS) }
|
||||
|
||||
// If there is no bootrom, the tile reset vector bundle will be tied to zero
|
||||
if (bootROM.isEmpty) {
|
||||
val fakeResetVectorSourceNode = BundleBridgeSource[UInt]()
|
||||
InModuleBody { fakeResetVectorSourceNode.bundle := 0.U }
|
||||
tileResetVectorNexusNode := fakeResetVectorSourceNode
|
||||
}
|
||||
|
||||
override lazy val module = new ChipyardSystemModule(this)
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class TestSuiteHelper
|
||||
*/
|
||||
def addGenericTestSuites(tiles: Seq[TileParams])(implicit p: Parameters) = {
|
||||
val xlen = p(XLen)
|
||||
tiles.find(_.hartId == 0).map { tileParams =>
|
||||
tiles.find(_.tileId == 0).map { tileParams =>
|
||||
val coreParams = tileParams.core
|
||||
val vm = coreParams.useVM
|
||||
val env = if (vm) List("p","v") else List("p")
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package chipyard.clocking
|
||||
|
||||
import chisel3._
|
||||
|
||||
import org.chipsalliance.cde.config.{Parameters, Field, Config}
|
||||
import freechips.rocketchip.diplomacy._
|
||||
import freechips.rocketchip.tilelink._
|
||||
import freechips.rocketchip.subsystem._
|
||||
import freechips.rocketchip.util._
|
||||
import freechips.rocketchip.tile._
|
||||
import freechips.rocketchip.prci._
|
||||
|
||||
case object ClockTapKey extends Field[Boolean](true)
|
||||
|
||||
trait CanHaveClockTap { this: BaseSubsystem =>
|
||||
require(!p(SubsystemDriveClockGroupsFromIO), "Subsystem must not drive clocks from IO")
|
||||
val clockTapNode = Option.when(p(ClockTapKey)) {
|
||||
val clockTap = ClockSinkNode(Seq(ClockSinkParameters(name=Some("clock_tap"))))
|
||||
clockTap := ClockGroup() := allClockGroupsNode
|
||||
clockTap
|
||||
}
|
||||
val clockTapIO = clockTapNode.map { node => InModuleBody {
|
||||
val clock_tap = IO(Output(Clock()))
|
||||
clock_tap := node.in.head._1.clock
|
||||
clock_tap
|
||||
}}
|
||||
}
|
||||
@@ -2,47 +2,36 @@ package chipyard.clocking
|
||||
|
||||
import chisel3._
|
||||
import chisel3.util._
|
||||
import chipyard.iobinders.{OverrideLazyIOBinder, GetSystemParameters, IOCellKey}
|
||||
import chipyard.iobinders._
|
||||
import freechips.rocketchip.prci._
|
||||
import freechips.rocketchip.diplomacy._
|
||||
import freechips.rocketchip.subsystem._
|
||||
import freechips.rocketchip.tilelink._
|
||||
import barstools.iocell.chisel._
|
||||
|
||||
class ClockWithFreq(val freqMHz: Double) extends Bundle {
|
||||
val clock = Clock()
|
||||
}
|
||||
|
||||
// This uses the FakePLL, which uses a ClockAtFreq Verilog blackbox to generate
|
||||
// the requested clocks. This also adds TileLink ClockDivider and ClockSelector
|
||||
// blocks, which allow memory-mapped control of clock division, and clock muxing
|
||||
// between the FakePLL and the slow off-chip clock
|
||||
// Note: This will not simulate properly with firesim
|
||||
class WithPLLSelectorDividerClockGenerator extends OverrideLazyIOBinder({
|
||||
// Unsetting enable will prevent the divider/selector from actually modifying the clock,
|
||||
// while preserving the address map. Unsetting enable should only be done for RTL
|
||||
// simulators (Verilator) which do not model reset properly
|
||||
class WithPLLSelectorDividerClockGenerator(enable: Boolean = true) extends OverrideLazyIOBinder({
|
||||
(system: HasChipyardPRCI) => {
|
||||
// Connect the implicit clock
|
||||
implicit val p = GetSystemParameters(system)
|
||||
val implicitClockSinkNode = ClockSinkNode(Seq(ClockSinkParameters(name = Some("implicit_clock"))))
|
||||
system.connectImplicitClockSinkNode(implicitClockSinkNode)
|
||||
InModuleBody {
|
||||
val implicit_clock = implicitClockSinkNode.in.head._1.clock
|
||||
val implicit_reset = implicitClockSinkNode.in.head._1.reset
|
||||
system.asInstanceOf[BaseSubsystem].module match { case l: LazyModuleImp => {
|
||||
l.clock := implicit_clock
|
||||
l.reset := implicit_reset
|
||||
}}
|
||||
}
|
||||
val tlbus = system.asInstanceOf[BaseSubsystem].locateTLBusWrapper(system.prciParams.slaveWhere)
|
||||
val baseAddress = system.prciParams.baseAddress
|
||||
val clockDivider = system.prci_ctrl_domain { LazyModule(new TLClockDivider (baseAddress + 0x20000, tlbus.beatBytes)) }
|
||||
val clockSelector = system.prci_ctrl_domain { LazyModule(new TLClockSelector(baseAddress + 0x30000, tlbus.beatBytes)) }
|
||||
val clockDivider = system.prci_ctrl_domain { LazyModule(new TLClockDivider (baseAddress + 0x20000, tlbus.beatBytes, enable=enable)) }
|
||||
val clockSelector = system.prci_ctrl_domain { LazyModule(new TLClockSelector(baseAddress + 0x30000, tlbus.beatBytes, enable=enable)) }
|
||||
val pllCtrl = system.prci_ctrl_domain { LazyModule(new FakePLLCtrl (baseAddress + 0x40000, tlbus.beatBytes)) }
|
||||
|
||||
clockDivider.tlNode := system.prci_ctrl_domain { TLFragmenter(tlbus.beatBytes, tlbus.blockBytes) := system.prci_ctrl_bus.get }
|
||||
clockSelector.tlNode := system.prci_ctrl_domain { TLFragmenter(tlbus.beatBytes, tlbus.blockBytes) := system.prci_ctrl_bus.get }
|
||||
pllCtrl.tlNode := system.prci_ctrl_domain { TLFragmenter(tlbus.beatBytes, tlbus.blockBytes) := system.prci_ctrl_bus.get }
|
||||
|
||||
system.allClockGroupsNode := clockDivider.clockNode := clockSelector.clockNode
|
||||
system.chiptopClockGroupsNode := clockDivider.clockNode := clockSelector.clockNode
|
||||
|
||||
// Connect all other requested clocks
|
||||
val slowClockSource = ClockSourceNode(Seq(ClockSourceParameters()))
|
||||
@@ -58,13 +47,13 @@ class WithPLLSelectorDividerClockGenerator extends OverrideLazyIOBinder({
|
||||
pllCtrlSink := pllCtrl.ctrlNode
|
||||
|
||||
InModuleBody {
|
||||
val clock_wire = Wire(Input(new ClockWithFreq(100)))
|
||||
val clock_wire = Wire(Input(Clock()))
|
||||
val reset_wire = Wire(Input(AsyncReset()))
|
||||
val (clock_io, clockIOCell) = IOCell.generateIOFromSignal(clock_wire, "clock", p(IOCellKey))
|
||||
val (reset_io, resetIOCell) = IOCell.generateIOFromSignal(reset_wire, "reset", p(IOCellKey))
|
||||
|
||||
slowClockSource.out.unzip._1.map { o =>
|
||||
o.clock := clock_wire.clock
|
||||
o.clock := clock_wire
|
||||
o.reset := reset_wire
|
||||
}
|
||||
|
||||
@@ -79,7 +68,7 @@ class WithPLLSelectorDividerClockGenerator extends OverrideLazyIOBinder({
|
||||
o.reset := reset_wire
|
||||
}
|
||||
|
||||
(Seq(clock_io, reset_io), clockIOCell ++ resetIOCell)
|
||||
(Seq(ClockPort(() => clock_io, 100), ResetPort(() => reset_io)), clockIOCell ++ resetIOCell)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -87,23 +76,12 @@ class WithPLLSelectorDividerClockGenerator extends OverrideLazyIOBinder({
|
||||
// This passes all clocks through to the TestHarness
|
||||
class WithPassthroughClockGenerator extends OverrideLazyIOBinder({
|
||||
(system: HasChipyardPRCI) => {
|
||||
// Connect the implicit clock
|
||||
implicit val p = GetSystemParameters(system)
|
||||
val implicitClockSinkNode = ClockSinkNode(Seq(ClockSinkParameters(name = Some("implicit_clock"))))
|
||||
system.connectImplicitClockSinkNode(implicitClockSinkNode)
|
||||
InModuleBody {
|
||||
val implicit_clock = implicitClockSinkNode.in.head._1.clock
|
||||
val implicit_reset = implicitClockSinkNode.in.head._1.reset
|
||||
system.asInstanceOf[BaseSubsystem].module match { case l: LazyModuleImp => {
|
||||
l.clock := implicit_clock
|
||||
l.reset := implicit_reset
|
||||
}}
|
||||
}
|
||||
|
||||
// This aggregate node should do nothing
|
||||
val clockGroupAggNode = ClockGroupAggregateNode("fake")
|
||||
val clockGroupsSourceNode = ClockGroupSourceNode(Seq(ClockGroupSourceParameters()))
|
||||
system.allClockGroupsNode := clockGroupAggNode := clockGroupsSourceNode
|
||||
system.chiptopClockGroupsNode := clockGroupAggNode := clockGroupsSourceNode
|
||||
|
||||
InModuleBody {
|
||||
val reset_io = IO(Input(AsyncReset()))
|
||||
@@ -114,12 +92,21 @@ class WithPassthroughClockGenerator extends OverrideLazyIOBinder({
|
||||
require(m.take.isDefined, s"""Clock ${m.name.get} has no requested frequency
|
||||
|Clocks: ${edge.sink.members.map(_.name.get)}""".stripMargin)
|
||||
val freq = m.take.get.freqMHz
|
||||
val clock_io = IO(Input(new ClockWithFreq(freq))).suggestName(s"clock_${m.name.get}")
|
||||
b.clock := clock_io.clock
|
||||
val clock_io = IO(Input(Clock())).suggestName(s"clock_${m.name.get}")
|
||||
b.clock := clock_io
|
||||
b.reset := reset_io
|
||||
clock_io
|
||||
ClockPort(() => clock_io, freq)
|
||||
}.toSeq
|
||||
((clock_ios :+ reset_io), Nil)
|
||||
((clock_ios :+ ResetPort(() => reset_io)), Nil)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
class WithClockTapIOCells extends OverrideIOBinder({
|
||||
(system: CanHaveClockTap) => {
|
||||
system.clockTapIO.map { tap =>
|
||||
val (clock_tap_io, clock_tap_cell) = IOCell.generateIOFromSignal(tap.getWrappedValue, "clock_tap")
|
||||
(Seq(ClockTapPort(() => clock_tap_io)), clock_tap_cell)
|
||||
}.getOrElse((Nil, Nil))
|
||||
}
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ package chipyard.clocking
|
||||
|
||||
import chisel3._
|
||||
import chisel3.util._
|
||||
import chisel3.experimental.{Analog, IO}
|
||||
import chisel3.experimental.Analog
|
||||
|
||||
import org.chipsalliance.cde.config._
|
||||
import freechips.rocketchip.subsystem._
|
||||
|
||||
@@ -51,7 +51,7 @@ object FrequencyUtils {
|
||||
require(!requestedOutputs.contains(0.0))
|
||||
val requestedFreqs = requestedOutputs.map(_.freqMHz)
|
||||
val fastestFreq = requestedFreqs.max
|
||||
require(fastestFreq <= maximumAllowableFreqMHz)
|
||||
require(fastestFreq <= maximumAllowableFreqMHz, s"Fastest Freq $fastestFreq > Max Freq $maximumAllowableFreqMHz")
|
||||
|
||||
val candidateFreqs =
|
||||
Seq.tabulate(Math.ceil(maximumAllowableFreqMHz / fastestFreq).toInt)(i => (i + 1) * fastestFreq)
|
||||
|
||||
@@ -14,7 +14,8 @@ import freechips.rocketchip.util._
|
||||
import freechips.rocketchip.tile._
|
||||
import freechips.rocketchip.prci._
|
||||
|
||||
import testchipip.{TLTileResetCtrl, ClockGroupFakeResetSynchronizer}
|
||||
import testchipip.boot.{TLTileResetCtrl}
|
||||
import testchipip.clocking.{ClockGroupFakeResetSynchronizer}
|
||||
|
||||
case class ChipyardPRCIControlParams(
|
||||
slaveWhere: TLBusWrapperLocation = CBUS,
|
||||
@@ -29,15 +30,14 @@ case class ChipyardPRCIControlParams(
|
||||
|
||||
case object ChipyardPRCIControlKey extends Field[ChipyardPRCIControlParams](ChipyardPRCIControlParams())
|
||||
|
||||
trait HasChipyardPRCI { this: BaseSubsystem with InstantiatesTiles =>
|
||||
require(p(SubsystemDriveAsyncClockGroupsKey).isEmpty, "Subsystem asyncClockGroups must be undriven")
|
||||
trait HasChipyardPRCI { this: BaseSubsystem with InstantiatesHierarchicalElements =>
|
||||
require(!p(SubsystemDriveClockGroupsFromIO), "Subsystem allClockGroups cannot be driven from implicit clocks")
|
||||
|
||||
val prciParams = p(ChipyardPRCIControlKey)
|
||||
|
||||
// Set up clock domain
|
||||
private val tlbus = locateTLBusWrapper(prciParams.slaveWhere)
|
||||
val prci_ctrl_domain = LazyModule(new ClockSinkDomain(name=Some("chipyard-prci-control")))
|
||||
prci_ctrl_domain.clockNode := tlbus.fixedClockNode
|
||||
val prci_ctrl_domain = tlbus.generateSynchronousDomain.suggestName("chipyard_prcictrl_domain")
|
||||
|
||||
val prci_ctrl_bus = Option.when(prciParams.generatePRCIXBar) { prci_ctrl_domain { TLXbar() } }
|
||||
prci_ctrl_bus.foreach(xbar => tlbus.coupleTo("prci_ctrl") { (xbar
|
||||
@@ -48,29 +48,13 @@ trait HasChipyardPRCI { this: BaseSubsystem with InstantiatesTiles =>
|
||||
|
||||
// Aggregate all the clock groups into a single node
|
||||
val aggregator = LazyModule(new ClockGroupAggregator("allClocks")).node
|
||||
val allClockGroupsNode = ClockGroupEphemeralNode()
|
||||
|
||||
// There are two "sets" of clocks which must be dealt with
|
||||
|
||||
// 1. The implicit clock from the subsystem. RC is moving away from depending on this
|
||||
// clock, but some modules still use it. Since the implicit clock sink node
|
||||
// is created in the ChipTop (the hierarchy wrapping the subsystem), this function
|
||||
// is provided to allow connecting that clock to the clock aggregator. This function
|
||||
// should be called in the ChipTop context
|
||||
def connectImplicitClockSinkNode(sink: ClockSinkNode) = {
|
||||
val implicitClockGrouper = this { ClockGroup() }
|
||||
(sink
|
||||
:= implicitClockGrouper
|
||||
:= aggregator)
|
||||
}
|
||||
|
||||
// 2. The rest of the diplomatic clocks in the subsystem are routed to this asyncClockGroupsNode
|
||||
// The diplomatic clocks in the subsystem are routed to this allClockGroupsNode
|
||||
val clockNamePrefixer = ClockGroupNamePrefixer()
|
||||
(asyncClockGroupsNode
|
||||
(allClockGroupsNode
|
||||
:*= clockNamePrefixer
|
||||
:*= aggregator)
|
||||
|
||||
|
||||
// Once all the clocks are gathered in the aggregator node, several steps remain
|
||||
// 1. Assign frequencies to any clock groups which did not specify a frequency.
|
||||
// 2. Combine duplicated clock groups (clock groups which physically should be in the same clock domain)
|
||||
@@ -91,7 +75,7 @@ trait HasChipyardPRCI { this: BaseSubsystem with InstantiatesTiles =>
|
||||
} }
|
||||
val tileResetSetter = Option.when(prciParams.enableTileResetSetting) { prci_ctrl_domain {
|
||||
val reset_setter = LazyModule(new TileResetSetter(prciParams.baseAddress + 0x10000, tlbus.beatBytes,
|
||||
tile_prci_domains.map(_.tile_reset_domain.clockNode.portParams(0).name.get), Nil))
|
||||
tile_prci_domains.map(_._2.tile_reset_domain.clockNode.portParams(0).name.get).toSeq, Nil))
|
||||
reset_setter.tlNode := TLFragmenter(tlbus.beatBytes, tlbus.blockBytes) := prci_ctrl_bus.get
|
||||
reset_setter
|
||||
} }
|
||||
@@ -115,11 +99,14 @@ RTL SIMULATORS, NAMELY VERILATOR.
|
||||
""" + Console.RESET)
|
||||
}
|
||||
|
||||
// The chiptopClockGroupsNode shouuld be what ClockBinders attach to
|
||||
val chiptopClockGroupsNode = ClockGroupEphemeralNode()
|
||||
|
||||
(aggregator
|
||||
:= frequencySpecifier
|
||||
:= clockGroupCombiner
|
||||
:= resetSynchronizer
|
||||
:= tileClockGater.map(_.clockNode).getOrElse(ClockGroupEphemeralNode()(ValName("temp")))
|
||||
:= tileResetSetter.map(_.clockNode).getOrElse(ClockGroupEphemeralNode()(ValName("temp")))
|
||||
:= allClockGroupsNode)
|
||||
:= chiptopClockGroupsNode)
|
||||
}
|
||||
|
||||
@@ -11,15 +11,31 @@ import freechips.rocketchip.util._
|
||||
import freechips.rocketchip.prci._
|
||||
import freechips.rocketchip.util.ElaborationArtefacts
|
||||
|
||||
import testchipip._
|
||||
import testchipip.clocking._
|
||||
|
||||
// This module adds a TileLink memory-mapped clock divider to the clock graph
|
||||
// The output clock/reset pairs from this module should be synchronized later
|
||||
class TLClockDivider(address: BigInt, beatBytes: Int, divBits: Int = 8)(implicit p: Parameters) extends LazyModule {
|
||||
// If enable is unset, this will not divide the clock
|
||||
// DO NOT unset enable for VLSI, or prototyping flows. The disable feature is a work around for
|
||||
// some RTL simulators which do not simulate the reset synchronization properly
|
||||
class TLClockDivider(address: BigInt, beatBytes: Int, divBits: Int = 8, enable: Boolean = true)(implicit p: Parameters) extends LazyModule {
|
||||
val device = new SimpleDevice(s"clk-div-ctrl", Nil)
|
||||
val clockNode = ClockGroupIdentityNode()
|
||||
val tlNode = TLRegisterNode(Seq(AddressSet(address, 4096-1)), device, "reg/control", beatBytes=beatBytes)
|
||||
|
||||
if (!enable) println(Console.RED + s"""
|
||||
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
WARNING:
|
||||
|
||||
YOU ARE USING THE TLCLOCKDIVIDER IN
|
||||
"DISABLED" MODE. THIS SHOULD ONLY BE DONE
|
||||
FOR RTL SIMULATION
|
||||
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
""" + Console.RESET)
|
||||
|
||||
lazy val module = new LazyModuleImp(this) {
|
||||
require (clockNode.out.size == 1)
|
||||
val sources = clockNode.in.head._1.member.data.toSeq
|
||||
@@ -38,13 +54,15 @@ class TLClockDivider(address: BigInt, beatBytes: Int, divBits: Int = 8)(implicit
|
||||
val reg = Module(new AsyncResetRegVec(w=divBits, init=0))
|
||||
|
||||
println(s"${(address+i*4).toString(16)}: Clock domain $sinkName divider")
|
||||
val divider = Module(new testchipip.ClockDivideOrPass(divBits, depth = 3, genClockGate = p(ClockGateImpl)))
|
||||
val divider = Module(new ClockDivideOrPass(divBits, depth = 3, genClockGate = p(ClockGateImpl)))
|
||||
divider.io.clockIn := sources(i).clock
|
||||
// busReset is expected to be high for a long time, since reset will take a while to propagate
|
||||
// to the TL bus. While reset is propagating, make sure we propagate a fast, undivided clock
|
||||
// by setting divisor=0. The divisor signal into the ClockDividerOrPass is synchronized internally
|
||||
divider.io.divisor := Mux(busReset.asBool, 0.U, reg.io.q)
|
||||
divider.io.resetAsync := ResetStretcher(sources(i).clock, asyncReset, 20).asAsyncReset
|
||||
|
||||
if (enable) {
|
||||
sinks(i)._2.clock := divider.io.clockOut
|
||||
|
||||
// Note this is not synchronized to the output clock, which takes time to appear
|
||||
@@ -52,6 +70,12 @@ class TLClockDivider(address: BigInt, beatBytes: Int, divBits: Int = 8)(implicit
|
||||
// Stretch the reset for 40 cycles, to give enough time to reset any downstream
|
||||
// digital logic
|
||||
sinks(i)._2.reset := ResetStretcher(sources(i).clock, asyncReset, 40).asAsyncReset
|
||||
} else {
|
||||
// WARNING: THIS IS FOR RTL SIMULATION ONLY
|
||||
sinks(i)._2.clock := sources(i).clock
|
||||
sinks(i)._2.reset := sources(i).reset
|
||||
}
|
||||
|
||||
reg
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import freechips.rocketchip.util._
|
||||
import freechips.rocketchip.prci._
|
||||
import freechips.rocketchip.util.ElaborationArtefacts
|
||||
|
||||
import testchipip._
|
||||
import testchipip.clocking._
|
||||
|
||||
case class ClockSelNode()(implicit valName: ValName)
|
||||
extends MixedNexusNode(ClockImp, ClockGroupImp)(
|
||||
@@ -21,12 +21,30 @@ case class ClockSelNode()(implicit valName: ValName)
|
||||
|
||||
// This module adds a TileLink memory-mapped clock mux for each downstream clock domain
|
||||
// in the clock graph. The output clock/reset should be synchronized downstream
|
||||
class TLClockSelector(address: BigInt, beatBytes: Int)(implicit p: Parameters) extends LazyModule {
|
||||
// If enable is unset, this will always pass through the 0'th clock
|
||||
// DO NOT unset enable for VLSI, or prototyping flows. The disable feature is a work around for
|
||||
// some RTL simulators which do not simulate the reset synchronization properly
|
||||
class TLClockSelector(address: BigInt, beatBytes: Int, enable: Boolean = true)(implicit p: Parameters) extends LazyModule {
|
||||
val device = new SimpleDevice("clk-sel-ctrl", Nil)
|
||||
val tlNode = TLRegisterNode(Seq(AddressSet(address, 4096-1)), device, "reg/control", beatBytes=beatBytes)
|
||||
|
||||
val clockNode = ClockSelNode()
|
||||
|
||||
if (!enable) println(Console.RED + s"""
|
||||
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
WARNING:
|
||||
|
||||
YOU ARE USING THE TLCLOCKSELECTOR IN
|
||||
"DISABLED" MODE. THIS SHOULD ONLY BE DONE
|
||||
FOR RTL SIMULATION
|
||||
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
""" + Console.RESET)
|
||||
|
||||
|
||||
|
||||
lazy val module = new LazyModuleImp(this) {
|
||||
val asyncReset = clockNode.in.map(_._1).map(_.reset).toSeq(0)
|
||||
val clocks = clockNode.in.map(_._1).map(_.clock)
|
||||
@@ -40,13 +58,18 @@ class TLClockSelector(address: BigInt, beatBytes: Int)(implicit p: Parameters) e
|
||||
sel := reg.io.q
|
||||
println(s"${(address+i*4).toString(16)}: Clock domain $sinkName clock mux")
|
||||
|
||||
val mux = testchipip.ClockMutexMux(clocks).suggestName(s"${sinkName}_clkmux")
|
||||
val mux = ClockMutexMux(clocks).suggestName(s"${sinkName}_clkmux")
|
||||
mux.io.sel := sel
|
||||
mux.io.resetAsync := asyncReset.asAsyncReset
|
||||
if (enable) {
|
||||
sinks(i).clock := mux.io.clockOut
|
||||
// Stretch the reset for 20 cycles, to give time to reset any downstream digital logic
|
||||
sinks(i).reset := ResetStretcher(clocks(0), asyncReset, 20).asAsyncReset
|
||||
|
||||
} else {
|
||||
// WARNING: THIS IS FOR RTL SIMULATION ONLY
|
||||
sinks(i).clock := clocks(0)
|
||||
sinks(i).reset := asyncReset
|
||||
}
|
||||
reg
|
||||
}
|
||||
tlNode.regmap((0 until sinks.size).map { i =>
|
||||
|
||||
@@ -2,7 +2,7 @@ package chipyard.clocking
|
||||
|
||||
import chisel3._
|
||||
import chisel3.util._
|
||||
import chisel3.experimental.{Analog, IO}
|
||||
import chisel3.experimental.Analog
|
||||
|
||||
import org.chipsalliance.cde.config._
|
||||
import freechips.rocketchip.subsystem._
|
||||
|
||||
@@ -2,7 +2,7 @@ package chipyard.clocking
|
||||
|
||||
import chisel3._
|
||||
import chisel3.util._
|
||||
import chisel3.experimental.{Analog, IO}
|
||||
import chisel3.experimental.Analog
|
||||
|
||||
import org.chipsalliance.cde.config._
|
||||
import freechips.rocketchip.subsystem._
|
||||
|
||||
@@ -15,15 +15,18 @@ class AbstractConfig extends Config(
|
||||
new chipyard.harness.WithUARTAdapter ++ // add UART adapter to display UART on stdout, if uart is present
|
||||
new chipyard.harness.WithBlackBoxSimMem ++ // add SimDRAM DRAM model for axi4 backing memory, if axi4 mem is enabled
|
||||
new chipyard.harness.WithSimTSIOverSerialTL ++ // add external serial-adapter and RAM
|
||||
new chipyard.harness.WithSimDebug ++ // add SimJTAG or SimDTM adapters if debug module is enabled
|
||||
new chipyard.harness.WithSimJTAGDebug ++ // add SimJTAG if JTAG for debug exposed
|
||||
new chipyard.harness.WithSimDMI ++ // add SimJTAG if DMI exposed
|
||||
new chipyard.harness.WithGPIOTiedOff ++ // tie-off chiptop GPIOs, if GPIOs are present
|
||||
new chipyard.harness.WithSimSPIFlashModel ++ // add simulated SPI flash memory, if SPI is enabled
|
||||
new chipyard.harness.WithSimAXIMMIO ++ // add SimAXIMem for axi4 mmio port, if enabled
|
||||
new chipyard.harness.WithTieOffInterrupts ++ // tie-off interrupt ports, if present
|
||||
new chipyard.harness.WithTieOffL2FBusAXI ++ // tie-off external AXI4 master, if present
|
||||
new chipyard.harness.WithCustomBootPinPlusArg ++ // drive custom-boot pin with a plusarg, if custom-boot-pin is present
|
||||
new chipyard.harness.WithDriveChipIdPin ++ // drive chip id pin from harness binder, if chip id pin is present
|
||||
new chipyard.harness.WithSimUARTToUARTTSI ++ // connect a SimUART to the UART-TSI port
|
||||
new chipyard.harness.WithClockAndResetFromHarness ++ // all Clock/Reset I/O in ChipTop should be driven by harnessClockInstantiator
|
||||
new chipyard.harness.WithClockFromHarness ++ // all Clock I/O in ChipTop should be driven by harnessClockInstantiator
|
||||
new chipyard.harness.WithResetFromHarness ++ // reset controlled by harness
|
||||
new chipyard.harness.WithAbsoluteFreqHarnessClockInstantiator ++ // generate clocks in harness with unsynthesizable ClockSourceAtFreqMHz
|
||||
|
||||
// The IOBinders instantiate ChipTop IOs to match desired digital IOs
|
||||
@@ -32,11 +35,14 @@ class AbstractConfig extends Config(
|
||||
new chipyard.iobinders.WithDebugIOCells ++
|
||||
new chipyard.iobinders.WithUARTIOCells ++
|
||||
new chipyard.iobinders.WithGPIOCells ++
|
||||
new chipyard.iobinders.WithSPIIOCells ++
|
||||
new chipyard.iobinders.WithSPIFlashIOCells ++
|
||||
new chipyard.iobinders.WithExtInterruptIOCells ++
|
||||
new chipyard.iobinders.WithChipIdIOCells ++
|
||||
new chipyard.iobinders.WithCustomBootPin ++
|
||||
// The "punchthrough" IOBInders below don't generate IOCells, as these interfaces shouldn't really be mapped to ASIC IO
|
||||
// Instead, they directly pass through the DigitalTop ports to ports in the ChipTop
|
||||
new chipyard.iobinders.WithI2CPunchthrough ++
|
||||
new chipyard.iobinders.WithSPIIOPunchthrough ++
|
||||
new chipyard.iobinders.WithAXI4MemPunchthrough ++
|
||||
new chipyard.iobinders.WithAXI4MMIOPunchthrough ++
|
||||
new chipyard.iobinders.WithTLMemPunchthrough ++
|
||||
@@ -47,22 +53,33 @@ class AbstractConfig extends Config(
|
||||
new chipyard.iobinders.WithUARTTSIPunchthrough ++
|
||||
new chipyard.iobinders.WithNMITiedOff ++
|
||||
|
||||
// By default, punch out IOs to the Harness
|
||||
new chipyard.clocking.WithPassthroughClockGenerator ++
|
||||
new chipyard.clocking.WithClockGroupsCombinedByName(("uncore", Seq("sbus", "mbus", "pbus", "fbus", "cbus", "implicit"), Seq("tile"))) ++
|
||||
new chipyard.clocking.WithClockTapIOCells ++ // Default generate a clock tapio
|
||||
new chipyard.clocking.WithPassthroughClockGenerator ++ // Default punch out IOs to the Harness
|
||||
new chipyard.clocking.WithClockGroupsCombinedByName(("uncore", // Default merge all the bus clocks
|
||||
Seq("sbus", "mbus", "pbus", "fbus", "cbus", "obus", "implicit", "clock_tap"), Seq("tile"))) ++
|
||||
new chipyard.config.WithPeripheryBusFrequency(500.0) ++ // Default 500 MHz pbus
|
||||
new chipyard.config.WithControlBusFrequency(500.0) ++ // Default 500 MHz cbus
|
||||
new chipyard.config.WithMemoryBusFrequency(500.0) ++ // Default 500 MHz mbus
|
||||
new chipyard.config.WithControlBusFrequency(500.0) ++ // Default 500 MHz cbus
|
||||
new chipyard.config.WithSystemBusFrequency(500.0) ++ // Default 500 MHz sbus
|
||||
new chipyard.config.WithFrontBusFrequency(500.0) ++ // Default 500 MHz fbus
|
||||
new chipyard.config.WithOffchipBusFrequency(500.0) ++ // Default 500 MHz obus
|
||||
|
||||
new testchipip.WithCustomBootPin ++ // add a custom-boot-pin to support pin-driven boot address
|
||||
new testchipip.WithBootAddrReg ++ // add a boot-addr-reg for configurable boot address
|
||||
new testchipip.WithSerialTLClientIdBits(4) ++ // support up to 1 << 4 simultaneous requests from serialTL port
|
||||
new testchipip.WithSerialTLWidth(32) ++ // fatten the serialTL interface to improve testing performance
|
||||
new testchipip.WithDefaultSerialTL ++ // use serialized tilelink port to external serialadapter/harnessRAM
|
||||
new testchipip.boot.WithCustomBootPin ++ // add a custom-boot-pin to support pin-driven boot address
|
||||
new testchipip.boot.WithBootAddrReg ++ // add a boot-addr-reg for configurable boot address
|
||||
new testchipip.serdes.WithSerialTL(Seq( // add a serial-tilelink interface
|
||||
testchipip.serdes.SerialTLParams(
|
||||
client = Some(testchipip.serdes.SerialTLClientParams()), // serial-tilelink interface will master the FBUS, and support 4 idBits
|
||||
phyParams = testchipip.serdes.ExternalSyncSerialParams(width=32) // serial-tilelink interface with 32 lanes
|
||||
)
|
||||
)) ++
|
||||
new testchipip.soc.WithMbusScratchpad(base = 0x08000000, // add 64 KiB on-chip scratchpad
|
||||
size = 64 * 1024) ++
|
||||
new chipyard.config.WithDebugModuleAbstractDataWords(8) ++ // increase debug module data capacity
|
||||
new chipyard.config.WithBootROM ++ // use default bootrom
|
||||
new chipyard.config.WithUART ++ // add a UART
|
||||
new chipyard.config.WithL2TLBs(1024) ++ // use L2 TLBs
|
||||
new chipyard.config.WithNoSubsystemDrivenClocks ++ // drive the subsystem diplomatic clocks from ChipTop instead of using implicit clocks
|
||||
new chipyard.config.WithNoSubsystemClockIO ++ // drive the subsystem diplomatic clocks from ChipTop instead of using implicit clocks
|
||||
new chipyard.config.WithInheritBusFrequencyAssignments ++ // Unspecified clocks within a bus will receive the bus frequency if set
|
||||
new freechips.rocketchip.subsystem.WithNMemoryChannels(1) ++ // Default 1 memory channels
|
||||
new freechips.rocketchip.subsystem.WithClockGateModel ++ // add default EICG_wrapper clock gate model
|
||||
|
||||
@@ -3,7 +3,7 @@ package chipyard
|
||||
import org.chipsalliance.cde.config.{Config}
|
||||
import freechips.rocketchip.diplomacy._
|
||||
import freechips.rocketchip.subsystem.{MBUS, SBUS}
|
||||
import testchipip.{OBUS}
|
||||
import testchipip.soc.{OBUS}
|
||||
|
||||
// A simple config demonstrating how to set up a basic chip in Chipyard
|
||||
class ChipLikeRocketConfig extends Config(
|
||||
@@ -22,16 +22,26 @@ class ChipLikeRocketConfig extends Config(
|
||||
//==================================
|
||||
// Set up I/O
|
||||
//==================================
|
||||
new testchipip.WithSerialTLWidth(4) ++ // 4bit wide Serialized TL interface to minimize IO
|
||||
new testchipip.WithSerialTLBackingMemory ++ // Configure the off-chip memory accessible over serial-tl as backing memory
|
||||
new freechips.rocketchip.subsystem.WithExtMemSize((1 << 30) * 4L) ++ // 4GB max external memory
|
||||
new testchipip.serdes.WithSerialTL(Seq(testchipip.serdes.SerialTLParams( // 1 serial tilelink port
|
||||
manager = Some(testchipip.serdes.SerialTLManagerParams( // port acts as a manager of offchip memory
|
||||
memParams = Seq(testchipip.serdes.ManagerRAMParams( // 4 GB of off-chip memory
|
||||
address = BigInt("80000000", 16),
|
||||
size = BigInt("100000000", 16)
|
||||
)),
|
||||
isMemoryDevice = true
|
||||
)),
|
||||
client = Some(testchipip.serdes.SerialTLClientParams()), // Allow an external manager to probe this chip
|
||||
phyParams = testchipip.serdes.ExternalSyncSerialParams(width=4) // 4-bit bidir interface, sync'd to an external clock
|
||||
))) ++
|
||||
|
||||
new freechips.rocketchip.subsystem.WithNoMemPort ++ // Remove axi4 mem port
|
||||
new freechips.rocketchip.subsystem.WithNMemoryChannels(1) ++ // 1 memory channel
|
||||
|
||||
//==================================
|
||||
// Set up buses
|
||||
//==================================
|
||||
new testchipip.WithOffchipBusClient(MBUS) ++ // offchip bus connects to MBUS, since the serial-tl needs to provide backing memory
|
||||
new testchipip.WithOffchipBus ++ // attach a offchip bus, since the serial-tl will master some external tilelink memory
|
||||
new testchipip.soc.WithOffchipBusClient(MBUS) ++ // offchip bus connects to MBUS, since the serial-tl needs to provide backing memory
|
||||
new testchipip.soc.WithOffchipBus ++ // attach a offchip bus, since the serial-tl will master some external tilelink memory
|
||||
|
||||
//==================================
|
||||
// Set up clock./reset
|
||||
@@ -43,6 +53,10 @@ class ChipLikeRocketConfig extends Config(
|
||||
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class FlatChipTopChipLikeRocketConfig extends Config(
|
||||
new chipyard.example.WithFlatChipTop ++
|
||||
new chipyard.ChipLikeRocketConfig)
|
||||
|
||||
// A simple config demonstrating a "bringup prototype" to bringup the ChipLikeRocketconfig
|
||||
class ChipBringupHostConfig extends Config(
|
||||
//=============================
|
||||
@@ -56,17 +70,23 @@ class ChipBringupHostConfig extends Config(
|
||||
//=============================
|
||||
// Setup the SerialTL side on the bringup device
|
||||
//=============================
|
||||
new testchipip.WithSerialTLWidth(4) ++ // match width with the chip
|
||||
new testchipip.WithSerialTLMem(base = 0x0, size = 0x80000000L, // accessible memory of the chip that doesn't come from the tethered host
|
||||
idBits = 4, isMainMemory = false) ++ // This assumes off-chip mem starts at 0x8000_0000
|
||||
new testchipip.WithSerialTLClockDirection(provideClockFreqMHz = Some(75)) ++ // bringup board drives the clock for the serial-tl receiver on the chip, use 75MHz clock
|
||||
new testchipip.serdes.WithSerialTL(Seq(testchipip.serdes.SerialTLParams(
|
||||
manager = Some(testchipip.serdes.SerialTLManagerParams(
|
||||
memParams = Seq(testchipip.serdes.ManagerRAMParams( // Bringup platform can access all memory from 0 to DRAM_BASE
|
||||
address = BigInt("00000000", 16),
|
||||
size = BigInt("80000000", 16)
|
||||
))
|
||||
)),
|
||||
client = Some(testchipip.serdes.SerialTLClientParams()), // Allow chip to access this device's memory (DRAM)
|
||||
phyParams = testchipip.serdes.InternalSyncSerialParams(width=4, freqMHz = 75) // bringup platform provides the clock
|
||||
))) ++
|
||||
|
||||
//============================
|
||||
// Setup bus topology on the bringup system
|
||||
//============================
|
||||
new testchipip.WithOffchipBusClient(SBUS, // offchip bus hangs off the SBUS
|
||||
new testchipip.soc.WithOffchipBusClient(SBUS, // offchip bus hangs off the SBUS
|
||||
blockRange = AddressSet.misaligned(0x80000000L, (BigInt(1) << 30) * 4)) ++ // offchip bus should not see the main memory of the testchip, since that can be accessed directly
|
||||
new testchipip.WithOffchipBus ++ // offchip bus
|
||||
new testchipip.soc.WithOffchipBus ++ // offchip bus
|
||||
|
||||
//=============================
|
||||
// Set up memory on the bringup system
|
||||
@@ -76,7 +96,7 @@ class ChipBringupHostConfig extends Config(
|
||||
//=============================
|
||||
// Generate the TSI-over-UART side of the bringup system
|
||||
//=============================
|
||||
new testchipip.WithUARTTSIClient(initBaudRate = BigInt(921600)) ++ // nonstandard baud rate to improve performance
|
||||
new testchipip.tsi.WithUARTTSIClient(initBaudRate = BigInt(921600)) ++ // nonstandard baud rate to improve performance
|
||||
|
||||
//=============================
|
||||
// Set up clocks of the bringup system
|
||||
@@ -85,6 +105,9 @@ class ChipBringupHostConfig extends Config(
|
||||
new chipyard.config.WithFrontBusFrequency(75.0) ++ // run all buses of this system at 75 MHz
|
||||
new chipyard.config.WithMemoryBusFrequency(75.0) ++
|
||||
new chipyard.config.WithPeripheryBusFrequency(75.0) ++
|
||||
new chipyard.config.WithSystemBusFrequency(75.0) ++
|
||||
new chipyard.config.WithControlBusFrequency(75.0) ++
|
||||
new chipyard.config.WithOffchipBusFrequency(75.0) ++
|
||||
|
||||
// Base is the no-cores config
|
||||
new chipyard.NoCoresConfig)
|
||||
@@ -103,5 +126,9 @@ class TetheredChipLikeRocketConfig extends Config(
|
||||
class VerilatorCITetheredChipLikeRocketConfig extends Config(
|
||||
new chipyard.harness.WithAbsoluteFreqHarnessClockInstantiator ++ // use absolute freqs for sims in the harness
|
||||
new chipyard.harness.WithMultiChipSerialTL(0, 1) ++ // connect the serial-tl ports of the chips together
|
||||
new chipyard.harness.WithMultiChip(0, new chipyard.config.WithNoResetSynchronizers ++ new ChipLikeRocketConfig) ++
|
||||
new chipyard.harness.WithMultiChip(0, // These fragments remove all troublesome
|
||||
new chipyard.clocking.WithPLLSelectorDividerClockGenerator(enable=false) ++ // clocking features from the design
|
||||
new chipyard.iobinders.WithDebugIOCells(syncReset = false) ++
|
||||
new chipyard.config.WithNoResetSynchronizers ++
|
||||
new ChipLikeRocketConfig) ++
|
||||
new chipyard.harness.WithMultiChip(1, new ChipBringupHostConfig))
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package chipyard
|
||||
|
||||
import org.chipsalliance.cde.config.{Config}
|
||||
import freechips.rocketchip.diplomacy.{AddressSet}
|
||||
import freechips.rocketchip.subsystem.{SBUS}
|
||||
import testchipip.soc.{OBUS}
|
||||
|
||||
// ------------------------------------------------
|
||||
// Configs demonstrating chip-to-chip communication
|
||||
// ------------------------------------------------
|
||||
|
||||
// Simple design which exposes a second serial-tl port that can connect to another instance of itself
|
||||
class SymmetricChipletRocketConfig extends Config(
|
||||
new testchipip.soc.WithChipIdPin ++ // Add pin to identify chips
|
||||
new chipyard.harness.WithSerialTLTiedOff(tieoffs=Some(Seq(1))) ++ // Tie-off the chip-to-chip link in single-chip sims
|
||||
new testchipip.serdes.WithSerialTL(Seq(
|
||||
testchipip.serdes.SerialTLParams( // 0th serial-tl is chip-to-bringup-fpga
|
||||
client = Some(testchipip.serdes.SerialTLClientParams()), // bringup serial-tl acts only as a client
|
||||
phyParams = testchipip.serdes.ExternalSyncSerialParams() // bringup serial-tl is sync'd to external clock
|
||||
),
|
||||
testchipip.serdes.SerialTLParams( // 1st serial-tl is chip-to-chip
|
||||
client = Some(testchipip.serdes.SerialTLClientParams()), // chip-to-chip serial-tl acts as a client
|
||||
manager = Some(testchipip.serdes.SerialTLManagerParams( // chip-to-chip serial-tl managers other chip's memory
|
||||
memParams = Seq(testchipip.serdes.ManagerRAMParams(
|
||||
address = 0,
|
||||
size = 1L << 32,
|
||||
)),
|
||||
slaveWhere = OBUS
|
||||
)),
|
||||
phyParams = testchipip.serdes.SourceSyncSerialParams() // chip-to-chip serial-tl is symmetric source-sync'd
|
||||
))
|
||||
) ++
|
||||
new testchipip.soc.WithOffchipBusClient(SBUS, // obus provides path to other chip's memory
|
||||
blockRange = Seq(AddressSet(0, (1L << 32) - 1)), // The lower 4GB is mapped to this chip
|
||||
replicationBase = Some(1L << 32) // The upper 4GB goes off-chip
|
||||
) ++
|
||||
new testchipip.soc.WithOffchipBus ++
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
// Simulates 2X of the SymmetricChipletRocketConfig in a multi-sim config
|
||||
class MultiSimSymmetricChipletRocketConfig extends Config(
|
||||
new chipyard.harness.WithAbsoluteFreqHarnessClockInstantiator ++
|
||||
new chipyard.harness.WithMultiChipSerialTL(chip0=0, chip1=1, chip0portId=1, chip1portId=1) ++
|
||||
new chipyard.harness.WithMultiChip(0, new SymmetricChipletRocketConfig) ++
|
||||
new chipyard.harness.WithMultiChip(1, new SymmetricChipletRocketConfig)
|
||||
)
|
||||
@@ -9,7 +9,7 @@ import freechips.rocketchip.diplomacy.{AsynchronousCrossing}
|
||||
|
||||
// DOC include start: FFTRocketConfig
|
||||
class FFTRocketConfig extends Config(
|
||||
new chipyard.iobinders.WithDontTouchIOBinders(false) ++ // TODO: hack around dontTouch not working in SFC
|
||||
new chipyard.harness.WithDontTouchChipTopPorts(false) ++ // TODO: hack around dontTouch not working in SFC
|
||||
new fftgenerator.WithFFTGenerator(numPoints=8, width=16, decPt=8) ++ // add 8-point mmio fft at the default addr (0x2400) with 16bit fixed-point numbers.
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
@@ -59,7 +59,7 @@ class LargeNVDLARocketConfig extends Config(
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class ManyMMIOAcceleratorRocketConfig extends Config(
|
||||
new chipyard.iobinders.WithDontTouchIOBinders(false) ++ // TODO: hack around dontTouch not working in SFC
|
||||
new chipyard.harness.WithDontTouchChipTopPorts(false) ++ // TODO: hack around dontTouch not working in SFC
|
||||
new fftgenerator.WithFFTGenerator(numPoints=8, width=16, decPt=8) ++ // add 8-point mmio fft at the default addr (0x2400) with 16bit fixed-point numbers.
|
||||
new chipyard.example.WithStreamingPassthrough ++ // use top with tilelink-controlled streaming passthrough
|
||||
new chipyard.example.WithStreamingFIR ++ // use top with tilelink-controlled streaming FIR
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package chipyard
|
||||
|
||||
import org.chipsalliance.cde.config.{Config}
|
||||
import freechips.rocketchip.diplomacy.{AsynchronousCrossing}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Configs which demonstrate modifying the uncore memory system
|
||||
// ------------------------------------------------------------
|
||||
|
||||
class SimAXIRocketConfig extends Config(
|
||||
new chipyard.harness.WithSimAXIMem ++ // drive the master AXI4 memory with a SimAXIMem, a 1-cycle magic memory, instead of default SimDRAM
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class GB1MemoryRocketConfig extends Config(
|
||||
new freechips.rocketchip.subsystem.WithExtMemSize((1<<30) * 1L) ++ // use 1GB simulated external memory
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
// DOC include start: mbusscratchpadrocket
|
||||
class MbusScratchpadOnlyRocketConfig extends Config(
|
||||
new testchipip.soc.WithMbusScratchpad(banks=2, partitions=2) ++ // add 2 partitions of 2 banks mbus backing scratchpad
|
||||
new freechips.rocketchip.subsystem.WithNoMemPort ++ // remove offchip mem port
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
// DOC include end: mbusscratchpadrocket
|
||||
|
||||
class SbusScratchpadRocketConfig extends Config(
|
||||
new testchipip.soc.WithSbusScratchpad(base=0x70000000L, banks=4) ++ // add 4 banks sbus scratchpad
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class SbusBypassRocketConfig extends Config(
|
||||
new freechips.rocketchip.subsystem.WithExtMemSbusBypass ++ // Add bypass path to access DRAM incoherently through an address alias
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class QuadChannelRocketConfig extends Config(
|
||||
new freechips.rocketchip.subsystem.WithNMemoryChannels(4) ++ // 4 AXI4 channels
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
@@ -6,6 +6,7 @@ import freechips.rocketchip.subsystem.{SBUS, MBUS}
|
||||
|
||||
import constellation.channel._
|
||||
import constellation.routing._
|
||||
import constellation.router._
|
||||
import constellation.topology._
|
||||
import constellation.noc._
|
||||
import constellation.soc.{GlobalNoCParams}
|
||||
@@ -45,7 +46,7 @@ import scala.collection.immutable.ListMap
|
||||
* | SI:Core 2 | SO:system[0] | SO:system[1] | SI:Core 3 |
|
||||
* |(0)___________|(1)___________|(2)___________|(3)___________|
|
||||
* | FBus | Core 0 | Core 1 | Pbus |
|
||||
* | SI:serial-tl | SI:Core 0 | SI:Core 1 | SO:pbus |
|
||||
* | SI:serial_tl | SI:Core 0 | SI:Core 1 | SO:pbus |
|
||||
* |______________|______________|______________|______________|
|
||||
*
|
||||
* |(0)___________|(1)___________|(2)___________|(3)___________|
|
||||
@@ -62,37 +63,37 @@ import scala.collection.immutable.ListMap
|
||||
*/
|
||||
// DOC include start: MultiNoCConfig
|
||||
class MultiNoCConfig extends Config(
|
||||
new constellation.soc.WithCbusNoC(constellation.protocol.TLNoCParams(
|
||||
new constellation.soc.WithCbusNoC(constellation.protocol.SimpleTLNoCParams(
|
||||
constellation.protocol.DiplomaticNetworkNodeMapping(
|
||||
inNodeMapping = ListMap(
|
||||
"serial-tl" -> 0),
|
||||
"serial_tl" -> 0),
|
||||
outNodeMapping = ListMap(
|
||||
"error" -> 1, "l2[0]" -> 2, "pbus" -> 3, "plic" -> 4,
|
||||
"error" -> 1, "ctrls[0]" -> 2, "pbus" -> 3, "plic" -> 4,
|
||||
"clint" -> 5, "dmInner" -> 6, "bootrom" -> 7, "clock" -> 8)),
|
||||
NoCParams(
|
||||
topology = TerminalRouter(BidirectionalLine(9)),
|
||||
channelParamGen = (a, b) => UserChannelParams(Seq.fill(5) { UserVirtualChannelParams(4) }),
|
||||
routingRelation = NonblockingVirtualSubnetworksRouting(TerminalRouterRouting(BidirectionalLineRouting()), 5, 1))
|
||||
)) ++
|
||||
new constellation.soc.WithMbusNoC(constellation.protocol.TLNoCParams(
|
||||
new constellation.soc.WithMbusNoC(constellation.protocol.SimpleTLNoCParams(
|
||||
constellation.protocol.DiplomaticNetworkNodeMapping(
|
||||
inNodeMapping = ListMap(
|
||||
"L2 InclusiveCache[0]" -> 1, "L2 InclusiveCache[1]" -> 2,
|
||||
"L2 InclusiveCache[2]" -> 5, "L2 InclusiveCache[3]" -> 6),
|
||||
outNodeMapping = ListMap(
|
||||
"system[0]" -> 0, "system[1]" -> 3, "system[2]" -> 4 , "system[3]" -> 7,
|
||||
"serdesser" -> 0)),
|
||||
"serial_tl_0" -> 0)),
|
||||
NoCParams(
|
||||
topology = TerminalRouter(BidirectionalTorus1D(8)),
|
||||
channelParamGen = (a, b) => UserChannelParams(Seq.fill(10) { UserVirtualChannelParams(4) }),
|
||||
routingRelation = BlockingVirtualSubnetworksRouting(TerminalRouterRouting(BidirectionalTorus1DShortestRouting()), 5, 2))
|
||||
)) ++
|
||||
new constellation.soc.WithSbusNoC(constellation.protocol.TLNoCParams(
|
||||
new constellation.soc.WithSbusNoC(constellation.protocol.SimpleTLNoCParams(
|
||||
constellation.protocol.DiplomaticNetworkNodeMapping(
|
||||
inNodeMapping = ListMap(
|
||||
"Core 0" -> 1, "Core 1" -> 2, "Core 2" -> 4 , "Core 3" -> 7,
|
||||
"Core 4" -> 8, "Core 5" -> 11, "Core 6" -> 13, "Core 7" -> 14,
|
||||
"serial-tl" -> 0),
|
||||
"serial_tl" -> 0),
|
||||
outNodeMapping = ListMap(
|
||||
"system[0]" -> 5, "system[1]" -> 6, "system[2]" -> 9, "system[3]" -> 10,
|
||||
"pbus" -> 3)),
|
||||
@@ -133,7 +134,7 @@ class MultiNoCConfig extends Config(
|
||||
* Core 6 | SI | Core 6 | 16
|
||||
* Core 7 | SI | Core 7 | 18
|
||||
* Core 8 | SI | Core 8 | 19
|
||||
* fbus | SI | serial-tl | 9
|
||||
* fbus | SI | serial_tl | 9
|
||||
* pbus | SO | pbus | 4
|
||||
* L2 0 | SO | system[0] | 0
|
||||
* L2 1 | SO | system[1] | 2
|
||||
@@ -145,7 +146,7 @@ class MultiNoCConfig extends Config(
|
||||
* L2 3 | MI | Cache[3] | 6
|
||||
* DRAM 0 | MO | system[0] | 3
|
||||
* DRAM 1 | MO | system[1] | 5
|
||||
* extram | MO | serdesser | 9
|
||||
* spad | MO | ram[0] | 9
|
||||
*/
|
||||
// DOC include start: SharedNoCConfig
|
||||
class SharedNoCConfig extends Config(
|
||||
@@ -162,24 +163,24 @@ class SharedNoCConfig extends Config(
|
||||
BidirectionalLineRouting()))), 10, 2)
|
||||
)
|
||||
)) ++
|
||||
new constellation.soc.WithMbusNoC(constellation.protocol.TLNoCParams(
|
||||
new constellation.soc.WithMbusNoC(constellation.protocol.GlobalTLNoCParams(
|
||||
constellation.protocol.DiplomaticNetworkNodeMapping(
|
||||
inNodeMapping = ListMap(
|
||||
"Cache[0]" -> 0, "Cache[1]" -> 2, "Cache[2]" -> 8, "Cache[3]" -> 6),
|
||||
outNodeMapping = ListMap(
|
||||
"system[0]" -> 3, "system[1]" -> 5,
|
||||
"serdesser" -> 9))
|
||||
), true) ++
|
||||
new constellation.soc.WithSbusNoC(constellation.protocol.TLNoCParams(
|
||||
"ram[0]" -> 9))
|
||||
)) ++
|
||||
new constellation.soc.WithSbusNoC(constellation.protocol.GlobalTLNoCParams(
|
||||
constellation.protocol.DiplomaticNetworkNodeMapping(
|
||||
inNodeMapping = ListMap(
|
||||
"serial-tl" -> 9, "Core 0" -> 2,
|
||||
"serial_tl" -> 9, "Core 0" -> 2,
|
||||
"Core 1" -> 10, "Core 2" -> 11, "Core 3" -> 13, "Core 4" -> 14,
|
||||
"Core 5" -> 15, "Core 6" -> 16, "Core 7" -> 18, "Core 8" -> 19),
|
||||
outNodeMapping = ListMap(
|
||||
"system[0]" -> 0, "system[1]" -> 2, "system[2]" -> 8, "system[3]" -> 6,
|
||||
"pbus" -> 4))
|
||||
), true) ++
|
||||
)) ++
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(8) ++
|
||||
new freechips.rocketchip.subsystem.WithNBanks(4) ++
|
||||
new freechips.rocketchip.subsystem.WithNMemoryChannels(2) ++
|
||||
@@ -187,8 +188,9 @@ class SharedNoCConfig extends Config(
|
||||
)
|
||||
// DOC include end: SharedNoCConfig
|
||||
|
||||
// This Config implements a simple ring interconnect for the system bus
|
||||
class SbusRingNoCConfig extends Config(
|
||||
new constellation.soc.WithSbusNoC(constellation.protocol.TLNoCParams(
|
||||
new constellation.soc.WithSbusNoC(constellation.protocol.SplitACDxBETLNoCParams(
|
||||
constellation.protocol.DiplomaticNetworkNodeMapping(
|
||||
inNodeMapping = ListMap(
|
||||
"Core 0" -> 0,
|
||||
@@ -199,19 +201,67 @@ class SbusRingNoCConfig extends Config(
|
||||
"Core 5" -> 5,
|
||||
"Core 6" -> 6,
|
||||
"Core 7" -> 7,
|
||||
"serial-tl" -> 8),
|
||||
"serial_tl" -> 8),
|
||||
outNodeMapping = ListMap(
|
||||
"system[0]" -> 9,
|
||||
"system[1]" -> 10,
|
||||
"system[2]" -> 11,
|
||||
"system[3]" -> 12,
|
||||
"pbus" -> 8)), // TSI is on the pbus, so serial-tl and pbus should be on the same node
|
||||
NoCParams(
|
||||
acdNoCParams = NoCParams(
|
||||
topology = UnidirectionalTorus1D(13),
|
||||
channelParamGen = (a, b) => UserChannelParams(Seq.fill(10) { UserVirtualChannelParams(4) }),
|
||||
routingRelation = NonblockingVirtualSubnetworksRouting(UnidirectionalTorus1DDatelineRouting(), 5, 2))
|
||||
channelParamGen = (a, b) => UserChannelParams(Seq.fill(6) { UserVirtualChannelParams(4) }),
|
||||
routingRelation = NonblockingVirtualSubnetworksRouting(UnidirectionalTorus1DDatelineRouting(), 3, 2)),
|
||||
beNoCParams = NoCParams(
|
||||
topology = UnidirectionalTorus1D(13),
|
||||
channelParamGen = (a, b) => UserChannelParams(Seq.fill(4) { UserVirtualChannelParams(1) }),
|
||||
routingRelation = NonblockingVirtualSubnetworksRouting(UnidirectionalTorus1DDatelineRouting(), 2, 2))
|
||||
)) ++
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(8) ++
|
||||
new freechips.rocketchip.subsystem.WithNBanks(4) ++
|
||||
new chipyard.config.AbstractConfig
|
||||
)
|
||||
|
||||
// This config integrates a mesh interconnect for the system bus, and divides the system bus
|
||||
// tilelink messages across two isolated interconnects
|
||||
class SbusMeshNoCConfig extends Config(
|
||||
new constellation.soc.WithSbusNoC(constellation.protocol.SplitACDxBETLNoCParams(
|
||||
constellation.protocol.DiplomaticNetworkNodeMapping(
|
||||
inNodeMapping = ListMap(
|
||||
"Core 0 " -> 0,
|
||||
"Core 1 " -> 1,
|
||||
"Core 2 " -> 2,
|
||||
"Core 3 " -> 3,
|
||||
"Core 4 " -> 4,
|
||||
"Core 5 " -> 7,
|
||||
"Core 6 " -> 8,
|
||||
"Core 7 " -> 11,
|
||||
"Core 8 " -> 12,
|
||||
"Core 9 " -> 13,
|
||||
"Core 10 " -> 14,
|
||||
"Core 11 " -> 15,
|
||||
"serial-tl" -> 0),
|
||||
outNodeMapping = ListMap(
|
||||
"system[0]" -> 5,
|
||||
"system[1]" -> 6,
|
||||
"system[2]" -> 9,
|
||||
"system[3]" -> 10,
|
||||
"pbus" -> 0)), // TSI is on the pbus, so serial-tl and pbus should be on the same node
|
||||
acdNoCParams = NoCParams(
|
||||
topology = Mesh2D(4, 4),
|
||||
channelParamGen = (a, b) => UserChannelParams(Seq.fill(3) { UserVirtualChannelParams(3) }, unifiedBuffer = false),
|
||||
routerParams = (i) => UserRouterParams(combineRCVA=true, combineSAST=true),
|
||||
routingRelation = NonblockingVirtualSubnetworksRouting(Mesh2DDimensionOrderedRouting(), 3, 1)),
|
||||
beNoCParams = NoCParams(
|
||||
topology = Mesh2D(4, 4),
|
||||
channelParamGen = (a, b) => UserChannelParams(Seq.fill(2) { UserVirtualChannelParams(3) }, unifiedBuffer = false),
|
||||
routerParams = (i) => UserRouterParams(combineRCVA=true, combineSAST=true),
|
||||
routingRelation = NonblockingVirtualSubnetworksRouting(Mesh2DDimensionOrderedRouting(), 2, 1)),
|
||||
beDivision = 4
|
||||
)) ++
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(12) ++
|
||||
new freechips.rocketchip.subsystem.WithNBanks(4) ++
|
||||
new chipyard.config.WithSystemBusWidth(128) ++
|
||||
new chipyard.config.AbstractConfig
|
||||
)
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@ import org.chipsalliance.cde.config.{Config}
|
||||
|
||||
// A empty config with no cores. Useful for testing
|
||||
class NoCoresConfig extends Config(
|
||||
new testchipip.WithNoBootAddrReg ++
|
||||
new testchipip.WithNoCustomBootPin ++
|
||||
new testchipip.soc.WithNoScratchpads ++
|
||||
new testchipip.boot.WithNoBootAddrReg ++
|
||||
new testchipip.boot.WithNoCustomBootPin ++
|
||||
new chipyard.config.WithNoCLINT ++
|
||||
new chipyard.config.WithNoBootROM ++
|
||||
new chipyard.config.WithBroadcastManager ++
|
||||
|
||||
@@ -22,13 +22,13 @@ class SmallSPIFlashRocketConfig extends Config(
|
||||
|
||||
class SimBlockDeviceRocketConfig extends Config(
|
||||
new chipyard.harness.WithSimBlockDevice ++ // drive block-device IOs with SimBlockDevice
|
||||
new testchipip.WithBlockDevice ++ // add block-device module to peripherybus
|
||||
new testchipip.iceblk.WithBlockDevice ++ // add block-device module to peripherybus
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class BlockDeviceModelRocketConfig extends Config(
|
||||
new chipyard.harness.WithBlockDeviceModel ++ // drive block-device IOs with a BlockDeviceModel
|
||||
new testchipip.WithBlockDevice ++ // add block-device module to periphery bus
|
||||
new testchipip.iceblk.WithBlockDevice ++ // add block-device module to periphery bus
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
@@ -52,7 +52,10 @@ class MMIORocketConfig extends Config(
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class LBWIFRocketConfig extends Config(
|
||||
new testchipip.WithSerialTLMem(isMainMemory=true) ++ // set lbwif memory base to DRAM_BASE, use as main memory
|
||||
new chipyard.config.WithOffchipBusFrequency(500) ++
|
||||
new testchipip.soc.WithOffchipBusClient(MBUS) ++
|
||||
new testchipip.soc.WithOffchipBus ++
|
||||
new testchipip.serdes.WithSerialTLMem(isMainMemory=true) ++ // set lbwif memory base to DRAM_BASE, use as main memory
|
||||
new freechips.rocketchip.subsystem.WithNoMemPort ++ // remove AXI4 backing memory
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
@@ -66,10 +69,10 @@ class dmiRocketConfig extends Config(
|
||||
// DOC include end: DmiRocket
|
||||
|
||||
class ManyPeripheralsRocketConfig extends Config(
|
||||
new testchipip.WithBlockDevice ++ // add block-device module to peripherybus
|
||||
new testchipip.WithOffchipBusClient(MBUS) ++ // OBUS provides backing memory to the MBUS
|
||||
new testchipip.WithOffchipBus ++ // OBUS must exist for serial-tl to master off-chip memory
|
||||
new testchipip.WithSerialTLMem(isMainMemory=true) ++ // set lbwif memory base to DRAM_BASE, use as main memory
|
||||
new testchipip.iceblk.WithBlockDevice ++ // add block-device module to peripherybus
|
||||
new testchipip.soc.WithOffchipBusClient(MBUS) ++ // OBUS provides backing memory to the MBUS
|
||||
new testchipip.soc.WithOffchipBus ++ // OBUS must exist for serial-tl to master off-chip memory
|
||||
new testchipip.serdes.WithSerialTLMem(isMainMemory=true) ++ // set lbwif memory base to DRAM_BASE, use as main memory
|
||||
new chipyard.harness.WithSimSPIFlashModel(true) ++ // add the SPI flash model in the harness (read-only)
|
||||
new chipyard.harness.WithSimBlockDevice ++ // drive block-device IOs with SimBlockDevice
|
||||
new chipyard.config.WithSPIFlash ++ // add the SPI flash controller
|
||||
@@ -79,14 +82,9 @@ class ManyPeripheralsRocketConfig extends Config(
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class QuadChannelRocketConfig extends Config(
|
||||
new freechips.rocketchip.subsystem.WithNMemoryChannels(4) ++ // 4 AXI4 channels
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class UARTTSIRocketConfig extends Config(
|
||||
new chipyard.harness.WithSerialTLTiedOff ++
|
||||
new testchipip.WithUARTTSIClient ++
|
||||
new testchipip.tsi.WithUARTTSIClient ++
|
||||
new chipyard.config.WithMemoryBusFrequency(10) ++
|
||||
new chipyard.config.WithFrontBusFrequency(10) ++
|
||||
new chipyard.config.WithPeripheryBusFrequency(10) ++
|
||||
|
||||
@@ -56,3 +56,9 @@ class HwachaLargeBoomConfig extends Config(
|
||||
new boom.common.WithNLargeBooms(1) ++
|
||||
new chipyard.config.WithSystemBusWidth(128) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class AES256ECBRocketConfig extends Config(
|
||||
new aes.WithAES256ECBAccel ++ // use Caliptra AES 256 ECB accelerator
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.WithSystemBusWidth(256) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
@@ -2,6 +2,7 @@ package chipyard
|
||||
|
||||
import org.chipsalliance.cde.config.{Config}
|
||||
import freechips.rocketchip.diplomacy.{AsynchronousCrossing}
|
||||
import freechips.rocketchip.subsystem.{InCluster}
|
||||
|
||||
// --------------
|
||||
// Rocket Configs
|
||||
@@ -12,18 +13,14 @@ class RocketConfig extends Config(
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class TinyRocketConfig extends Config(
|
||||
new chipyard.iobinders.WithDontTouchIOBinders(false) ++ // TODO FIX: Don't dontTouch the ports
|
||||
new chipyard.harness.WithDontTouchChipTopPorts(false) ++ // TODO FIX: Don't dontTouch the ports
|
||||
new testchipip.soc.WithNoScratchpads ++ // All memory is the Rocket TCMs
|
||||
new freechips.rocketchip.subsystem.WithIncoherentBusTopology ++ // use incoherent bus topology
|
||||
new freechips.rocketchip.subsystem.WithNBanks(0) ++ // remove L2$
|
||||
new freechips.rocketchip.subsystem.WithNoMemPort ++ // remove backing memory
|
||||
new freechips.rocketchip.subsystem.With1TinyCore ++ // single tiny rocket-core
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class SimAXIRocketConfig extends Config(
|
||||
new chipyard.harness.WithSimAXIMem ++ // drive the master AXI4 memory with a SimAXIMem, a 1-cycle magic memory, instead of default SimDRAM
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class QuadRocketConfig extends Config(
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(4) ++ // quad-core (4 RocketTiles)
|
||||
new chipyard.config.AbstractConfig)
|
||||
@@ -38,14 +35,10 @@ class RV32RocketConfig extends Config(
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class GB1MemoryRocketConfig extends Config(
|
||||
new freechips.rocketchip.subsystem.WithExtMemSize((1<<30) * 1L) ++ // use 1GB simulated external memory
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
// DOC include start: l1scratchpadrocket
|
||||
class ScratchpadOnlyRocketConfig extends Config(
|
||||
new chipyard.config.WithL2TLBs(0) ++
|
||||
new testchipip.soc.WithNoScratchpads ++ // remove subsystem scratchpads, confusingly named, does not remove the L1D$ scratchpads
|
||||
new freechips.rocketchip.subsystem.WithNBanks(0) ++
|
||||
new freechips.rocketchip.subsystem.WithNoMemPort ++ // remove offchip mem port
|
||||
new freechips.rocketchip.subsystem.WithScratchpadsOnly ++ // use rocket l1 DCache scratchpad as base phys mem
|
||||
@@ -65,26 +58,12 @@ class L1ScratchpadRocketConfig extends Config(
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
// DOC include start: mbusscratchpadrocket
|
||||
class MbusScratchpadOnlyRocketConfig extends Config(
|
||||
new testchipip.WithMbusScratchpad(banks=2, partitions=2) ++ // add 2 partitions of 2 banks mbus backing scratchpad
|
||||
new freechips.rocketchip.subsystem.WithNoMemPort ++ // remove offchip mem port
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
// DOC include end: mbusscratchpadrocket
|
||||
|
||||
class SbusScratchpadRocketConfig extends Config(
|
||||
new testchipip.WithSbusScratchpad(base=0x70000000L, banks=4) ++ // add 4 banks sbus backing scratchpad
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
|
||||
class MulticlockRocketConfig extends Config(
|
||||
new freechips.rocketchip.subsystem.WithAsynchronousRocketTiles(3, 3) ++ // Add async crossings between RocketTile and uncore
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
|
||||
// Frequency specifications
|
||||
new chipyard.config.WithTileFrequency(1000.0) ++ // Matches the maximum frequency of U540
|
||||
new chipyard.clocking.WithClockGroupsCombinedByName(("uncore" , Seq("sbus", "cbus", "implicit"), Nil),
|
||||
new chipyard.clocking.WithClockGroupsCombinedByName(("uncore" , Seq("sbus", "cbus", "implicit", "clock_tap"), Nil),
|
||||
("periphery", Seq("pbus", "fbus"), Nil)) ++
|
||||
new chipyard.config.WithSystemBusFrequency(500.0) ++ // Matches the maximum frequency of U540
|
||||
new chipyard.config.WithMemoryBusFrequency(500.0) ++ // Matches the maximum frequency of U540
|
||||
@@ -93,10 +72,10 @@ class MulticlockRocketConfig extends Config(
|
||||
new chipyard.config.WithFbusToSbusCrossingType(AsynchronousCrossing()) ++ // Add Async crossing between FBUS and SBUS
|
||||
new chipyard.config.WithCbusToPbusCrossingType(AsynchronousCrossing()) ++ // Add Async crossing between PBUS and CBUS
|
||||
new chipyard.config.WithSbusToMbusCrossingType(AsynchronousCrossing()) ++ // Add Async crossings between backside of L2 and MBUS
|
||||
new testchipip.WithAsynchronousSerialSlaveCrossing ++ // Add Async crossing between serial and MBUS. Its master-side is tied to the FBUS
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class CustomIOChipTopRocketConfig extends Config(
|
||||
new chipyard.example.WithBrokenOutUARTIO ++
|
||||
new chipyard.example.WithCustomChipTop ++
|
||||
new chipyard.example.WithCustomIOCells ++
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++ // single rocket-core
|
||||
@@ -110,3 +89,10 @@ class PrefetchingRocketConfig extends Config(
|
||||
new freechips.rocketchip.subsystem.WithNonblockingL1(2) ++ // non-blocking L1D$, L1 prefetching only works with non-blocking L1D$
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(1) ++ // single rocket-core
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
class ClusteredRocketConfig extends Config(
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(4, location=InCluster(1)) ++
|
||||
new freechips.rocketchip.subsystem.WithNBigCores(4, location=InCluster(0)) ++
|
||||
new freechips.rocketchip.subsystem.WithCluster(1) ++
|
||||
new freechips.rocketchip.subsystem.WithCluster(0) ++
|
||||
new chipyard.config.AbstractConfig)
|
||||
|
||||
@@ -7,7 +7,8 @@ import org.chipsalliance.cde.config.{Config}
|
||||
class Sodor1StageConfig extends Config(
|
||||
// Create a Sodor 1-stage core
|
||||
new sodor.common.WithNSodorCores(1, internalTile = sodor.common.Stage1Factory) ++
|
||||
new testchipip.WithSerialTLWidth(32) ++
|
||||
new testchipip.soc.WithNoScratchpads ++ // No scratchpads
|
||||
new testchipip.serdes.WithSerialTLWidth(32) ++
|
||||
new freechips.rocketchip.subsystem.WithScratchpadsOnly ++ // use sodor tile-internal scratchpad
|
||||
new freechips.rocketchip.subsystem.WithNoMemPort ++ // use no external memory
|
||||
new freechips.rocketchip.subsystem.WithNBanks(0) ++
|
||||
@@ -16,7 +17,8 @@ class Sodor1StageConfig extends Config(
|
||||
class Sodor2StageConfig extends Config(
|
||||
// Create a Sodor 2-stage core
|
||||
new sodor.common.WithNSodorCores(1, internalTile = sodor.common.Stage2Factory) ++
|
||||
new testchipip.WithSerialTLWidth(32) ++
|
||||
new testchipip.soc.WithNoScratchpads ++ // No scratchpads
|
||||
new testchipip.serdes.WithSerialTLWidth(32) ++
|
||||
new freechips.rocketchip.subsystem.WithScratchpadsOnly ++ // use sodor tile-internal scratchpad
|
||||
new freechips.rocketchip.subsystem.WithNoMemPort ++ // use no external memory
|
||||
new freechips.rocketchip.subsystem.WithNBanks(0) ++
|
||||
@@ -25,7 +27,8 @@ class Sodor2StageConfig extends Config(
|
||||
class Sodor3StageConfig extends Config(
|
||||
// Create a Sodor 1-stage core with two ports
|
||||
new sodor.common.WithNSodorCores(1, internalTile = sodor.common.Stage3Factory(ports = 2)) ++
|
||||
new testchipip.WithSerialTLWidth(32) ++
|
||||
new testchipip.soc.WithNoScratchpads ++ // No scratchpads
|
||||
new testchipip.serdes.WithSerialTLWidth(32) ++
|
||||
new freechips.rocketchip.subsystem.WithScratchpadsOnly ++ // use sodor tile-internal scratchpad
|
||||
new freechips.rocketchip.subsystem.WithNoMemPort ++ // use no external memory
|
||||
new freechips.rocketchip.subsystem.WithNBanks(0) ++
|
||||
@@ -34,7 +37,8 @@ class Sodor3StageConfig extends Config(
|
||||
class Sodor3StageSinglePortConfig extends Config(
|
||||
// Create a Sodor 3-stage core with one ports (instruction and data memory access controlled by arbiter)
|
||||
new sodor.common.WithNSodorCores(1, internalTile = sodor.common.Stage3Factory(ports = 1)) ++
|
||||
new testchipip.WithSerialTLWidth(32) ++
|
||||
new testchipip.soc.WithNoScratchpads ++ // No scratchpads
|
||||
new testchipip.serdes.WithSerialTLWidth(32) ++
|
||||
new freechips.rocketchip.subsystem.WithScratchpadsOnly ++ // use sodor tile-internal scratchpad
|
||||
new freechips.rocketchip.subsystem.WithNoMemPort ++ // use no external memory
|
||||
new freechips.rocketchip.subsystem.WithNBanks(0) ++
|
||||
@@ -43,7 +47,8 @@ class Sodor3StageSinglePortConfig extends Config(
|
||||
class Sodor5StageConfig extends Config(
|
||||
// Create a Sodor 5-stage core
|
||||
new sodor.common.WithNSodorCores(1, internalTile = sodor.common.Stage5Factory) ++
|
||||
new testchipip.WithSerialTLWidth(32) ++
|
||||
new testchipip.soc.WithNoScratchpads ++ // No scratchpads
|
||||
new testchipip.serdes.WithSerialTLWidth(32) ++
|
||||
new freechips.rocketchip.subsystem.WithScratchpadsOnly ++ // use sodor tile-internal scratchpad
|
||||
new freechips.rocketchip.subsystem.WithNoMemPort ++ // use no external memory
|
||||
new freechips.rocketchip.subsystem.WithNBanks(0) ++
|
||||
@@ -52,7 +57,8 @@ class Sodor5StageConfig extends Config(
|
||||
class SodorUCodeConfig extends Config(
|
||||
// Construct a Sodor microcode-based single-bus core
|
||||
new sodor.common.WithNSodorCores(1, internalTile = sodor.common.UCodeFactory) ++
|
||||
new testchipip.WithSerialTLWidth(32) ++
|
||||
new testchipip.soc.WithNoScratchpads ++ // No scratchpads
|
||||
new testchipip.serdes.WithSerialTLWidth(32) ++
|
||||
new freechips.rocketchip.subsystem.WithScratchpadsOnly ++ // use sodor tile-internal scratchpad
|
||||
new freechips.rocketchip.subsystem.WithNoMemPort ++ // use no external memory
|
||||
new freechips.rocketchip.subsystem.WithNBanks(0) ++
|
||||
|
||||
@@ -43,7 +43,7 @@ class SpikeUltraFastDevicesConfig extends Config(
|
||||
new chipyard.harness.WithSimBlockDevice ++
|
||||
new chipyard.harness.WithLoopbackNIC ++
|
||||
new icenet.WithIceNIC ++
|
||||
new testchipip.WithBlockDevice ++
|
||||
new testchipip.iceblk.WithBlockDevice ++
|
||||
|
||||
new chipyard.WithSpikeTCM ++
|
||||
new chipyard.WithNSpikeCores(1) ++
|
||||
|
||||
@@ -7,14 +7,16 @@ class AbstractTraceGenConfig extends Config(
|
||||
new chipyard.harness.WithAbsoluteFreqHarnessClockInstantiator ++
|
||||
new chipyard.harness.WithBlackBoxSimMem ++
|
||||
new chipyard.harness.WithTraceGenSuccess ++
|
||||
new chipyard.harness.WithClockAndResetFromHarness ++
|
||||
new chipyard.harness.WithClockFromHarness ++
|
||||
new chipyard.harness.WithResetFromHarness ++
|
||||
new chipyard.iobinders.WithAXI4MemPunchthrough ++
|
||||
new chipyard.iobinders.WithTraceGenSuccessPunchthrough ++
|
||||
new chipyard.clocking.WithPassthroughClockGenerator ++
|
||||
new chipyard.clocking.WithClockGroupsCombinedByName(("uncore", Seq("sbus", "implicit"), Nil)) ++
|
||||
new chipyard.clocking.WithClockGroupsCombinedByName(("uncore", Seq("sbus"), Nil)) ++
|
||||
new chipyard.config.WithTracegenSystem ++
|
||||
new chipyard.config.WithNoSubsystemDrivenClocks ++
|
||||
new chipyard.config.WithNoSubsystemClockIO ++
|
||||
new chipyard.config.WithMemoryBusFrequency(1000.0) ++
|
||||
new chipyard.config.WithControlBusFrequency(1000.0) ++
|
||||
new chipyard.config.WithSystemBusFrequency(1000.0) ++
|
||||
new chipyard.config.WithPeripheryBusFrequency(1000.0) ++
|
||||
new freechips.rocketchip.subsystem.WithCoherentBusTopology ++
|
||||
@@ -42,6 +44,6 @@ class NonBlockingTraceGenL2Config extends Config(
|
||||
|
||||
class NonBlockingTraceGenL2RingConfig extends Config(
|
||||
new tracegen.WithL2TraceGen()(List.fill(2)(DCacheParams(nMSHRs = 2, nSets = 16, nWays = 4))) ++
|
||||
new testchipip.WithRingSystemBus ++
|
||||
new testchipip.soc.WithRingSystemBus ++
|
||||
new freechips.rocketchip.subsystem.WithInclusiveCache ++
|
||||
new AbstractTraceGenConfig)
|
||||
|
||||
@@ -77,7 +77,7 @@ class TutorialSha3BlackBoxConfig extends Config(
|
||||
|
||||
// Tutorial Phase 5: Map a multicore heterogeneous SoC with multiple cores and memory-mapped accelerators
|
||||
class TutorialNoCConfig extends Config(
|
||||
new chipyard.iobinders.WithDontTouchIOBinders(false) ++
|
||||
new chipyard.harness.WithDontTouchChipTopPorts(false) ++
|
||||
// Try changing the dimensions of the Mesh topology
|
||||
new constellation.soc.WithGlobalNoC(constellation.soc.GlobalNoCParams(
|
||||
NoCParams(
|
||||
@@ -90,14 +90,14 @@ class TutorialNoCConfig extends Config(
|
||||
// The inNodeMapping and outNodeMapping values are the physical identifiers of
|
||||
// routers on the topology to map the agents to. Try changing these to any
|
||||
// value within the range [0, topology.nNodes)
|
||||
new constellation.soc.WithPbusNoC(constellation.protocol.TLNoCParams(
|
||||
new constellation.soc.WithPbusNoC(constellation.protocol.GlobalTLNoCParams(
|
||||
constellation.protocol.DiplomaticNetworkNodeMapping(
|
||||
inNodeMapping = ListMap("Core" -> 7),
|
||||
outNodeMapping = ListMap(
|
||||
"pbus" -> 8, "uart" -> 9, "control" -> 10, "gcd" -> 11,
|
||||
"writeQueue[0]" -> 0, "writeQueue[1]" -> 1, "tailChain[0]" -> 2))
|
||||
), true) ++
|
||||
new constellation.soc.WithSbusNoC(constellation.protocol.TLNoCParams(
|
||||
)) ++
|
||||
new constellation.soc.WithSbusNoC(constellation.protocol.GlobalTLNoCParams(
|
||||
constellation.protocol.DiplomaticNetworkNodeMapping(
|
||||
inNodeMapping = ListMap(
|
||||
"Core 0" -> 0, "Core 1" -> 1,
|
||||
@@ -105,7 +105,7 @@ class TutorialNoCConfig extends Config(
|
||||
outNodeMapping = ListMap(
|
||||
"system[0]" -> 3, "system[1]" -> 4, "system[2]" -> 5, "system[3]" -> 6,
|
||||
"pbus" -> 7))
|
||||
), true) ++
|
||||
)) ++
|
||||
new chipyard.example.WithGCD ++
|
||||
new chipyard.harness.WithLoopbackNIC ++
|
||||
new icenet.WithIceNIC ++
|
||||
|
||||
@@ -13,13 +13,14 @@ import freechips.rocketchip.tilelink.{HasTLBusParams}
|
||||
|
||||
import chipyard._
|
||||
import chipyard.clocking._
|
||||
import testchipip.soc.{OffchipBusKey}
|
||||
|
||||
// The default RocketChip BaseSubsystem drives its diplomatic clock graph
|
||||
// with the implicit clocks of Subsystem. Don't do that, instead we extend
|
||||
// the diplomacy graph upwards into the ChipTop, where we connect it to
|
||||
// our clock drivers
|
||||
class WithNoSubsystemDrivenClocks extends Config((site, here, up) => {
|
||||
case SubsystemDriveAsyncClockGroupsKey => None
|
||||
class WithNoSubsystemClockIO extends Config((site, here, up) => {
|
||||
case SubsystemDriveClockGroupsFromIO => false
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -103,18 +104,29 @@ class WithFrontBusFrequency(freqMHz: Double) extends Config((site, here, up) =>
|
||||
class WithControlBusFrequency(freqMHz: Double) extends Config((site, here, up) => {
|
||||
case ControlBusKey => up(ControlBusKey, site).copy(dtsFrequency = Some(BigInt((freqMHz * 1e6).toLong)))
|
||||
})
|
||||
class WithOffchipBusFrequency(freqMHz: Double) extends Config((site, here, up) => {
|
||||
case OffchipBusKey => up(OffchipBusKey, site).copy(dtsFrequency = Some(BigInt((freqMHz * 1e6).toLong)))
|
||||
})
|
||||
|
||||
class WithRationalMemoryBusCrossing extends WithSbusToMbusCrossingType(RationalCrossing(Symmetric))
|
||||
class WithAsynchrousMemoryBusCrossing extends WithSbusToMbusCrossingType(AsynchronousCrossing())
|
||||
|
||||
// Remove the tile clock gaters in this system
|
||||
class WithNoTileClockGaters extends Config((site, here, up) => {
|
||||
case ChipyardPRCIControlKey => up(ChipyardPRCIControlKey).copy(enableTileClockGating = false)
|
||||
})
|
||||
|
||||
// Remove the tile reset control blocks in this system
|
||||
class WithNoTileResetSetters extends Config((site, here, up) => {
|
||||
case ChipyardPRCIControlKey => up(ChipyardPRCIControlKey).copy(enableTileResetSetting = false)
|
||||
})
|
||||
|
||||
// Remove the global reset synchronizers in this system
|
||||
class WithNoResetSynchronizers extends Config((site, here, up) => {
|
||||
case ChipyardPRCIControlKey => up(ChipyardPRCIControlKey).copy(enableResetSynchronizers = false)
|
||||
})
|
||||
|
||||
// Remove any ClockTap ports in this system
|
||||
class WithNoClockTap extends Config((site, here, up) => {
|
||||
case ClockTapKey => false
|
||||
})
|
||||
|
||||
@@ -29,7 +29,7 @@ import chipyard.{ExtTLMem}
|
||||
* @param hang the power-on reset vector, i.e. the program counter will be set to this value on reset
|
||||
* @param contentFileName the path to the BootROM image
|
||||
*/
|
||||
class WithBootROM(address: BigInt = 0x10000, size: Int = 0x10000, hang: BigInt = 0x10040) extends Config((site, here, up) => {
|
||||
class WithBootROM(address: BigInt = 0x10000, size: Int = 0x10000, hang: BigInt = 0x10000) extends Config((site, here, up) => {
|
||||
case BootROMLocated(x) => up(BootROMLocated(x), site)
|
||||
.map(_.copy(
|
||||
address = address,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user