Skip to content

Commit

Permalink
Merge branch 'dev-integrate' into dev-public
Browse files Browse the repository at this point in the history
  • Loading branch information
anjpar authored May 10, 2023
2 parents 51be55d + fc68dd2 commit 18e8501
Show file tree
Hide file tree
Showing 645 changed files with 50,211 additions and 6,397 deletions.
103 changes: 88 additions & 15 deletions .github/workflows/build-test-verilator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ on:

workflow_dispatch:

env:
CARGO_INCREMENTAL: 0
SCCACHE_VERSION: 0.3.3
RISCV_VERSION: v12.1.0
# TODO: To update to 5.006, clean up lint errors
VERILATOR_VERSION: v5.002
PKG_CONFIG_PATH: /opt/verilator/share/pkgconfig
SCCACHE_GHA_CACHE_TO: sccache-verilator-10000
SCCACHE_GHA_CACHE_FROM: sccache-verilator-
# Change this to a new random value if you suspect the cache is corrupted
SCCACHE_C_CUSTOM_CACHE_BUSTER: f3e6951f0c1d

jobs:
build_matrix:
name: Build Smoke Test matrix
Expand Down Expand Up @@ -36,18 +48,6 @@ jobs:
matrix:
test_name: ${{fromJSON(needs.build_matrix.outputs.test_names)}}

env:
CARGO_INCREMENTAL: 0
SCCACHE_VERSION: 0.3.3
RISCV_VERSION: v12.1.0
# TODO: To update to 5.006, clean up lint errors
VERILATOR_VERSION: v4.228
PKG_CONFIG_PATH: /opt/verilator/share/pkgconfig
SCCACHE_GHA_CACHE_TO: sccache-verilator-10000
SCCACHE_GHA_CACHE_FROM: sccache-verilator-
# Change this to a new random value if you suspect the cache is corrupted
SCCACHE_C_CUSTOM_CACHE_BUSTER: f3e6951f0c1d

steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -135,14 +135,87 @@ jobs:
path: /opt/riscv
key: riscv-${{ env.RISCV_VERSION }}-${{ env.SCCACHE_C_CUSTOM_CACHE_BUSTER }}

- name: Setup riscv path
run: |
echo /opt/riscv/bin >> $GITHUB_PATH
build_matrix:
name: Build Smoke Test matrix
runs-on: ubuntu-22.04
needs: build_tools
outputs:
test_names: ${{ steps.output-matrix.outputs.test_names }}
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
sudo apt-get update -qy && sudo apt-get install -qy --no-install-recommends \
python3-minimal python3-yaml
- name: Build matrix
id: output-matrix
run: |
echo "test_names=$(python3 .github/scripts/build_tests_matrix.py)" >> $GITHUB_OUTPUT
build_and_test:
name: Verilator Smoke Test
runs-on: ubuntu-22.04
needs: build_matrix

strategy:
fail-fast: false
matrix:
test_name: ${{fromJSON(needs.build_matrix.outputs.test_names)}}

steps:
- uses: actions/checkout@v3
with:
submodules: 'true'

- name: Restore Cargo index
uses: actions/cache/restore@v3
id: cargo_index_restore
with:
path: ~/.cargo/registry/index
key: cargo-index-${{ env.SCCACHE_C_CUSTOM_CACHE_BUSTER }}-${{ hashFiles('Cargo.lock') }}

- name: Restore sccache binary
uses: actions/cache/restore@v3
id: sccache_bin_restore
with:
path: ~/.cargo/bin/sccache
key: sccache-bin-${{ env.SCCACHE_VERSION }}-${{ env.SCCACHE_C_CUSTOM_CACHE_BUSTER }}

- name: Restore verilator dir
uses: actions/cache/restore@v3
id: verilator_restore
with:
path: /opt/verilator
key: verilator-${{ env.VERILATOR_VERSION }}-${{ env.SCCACHE_C_CUSTOM_CACHE_BUSTER }}

- name: Restore Risc V Toolchain
uses: actions/cache/restore@v3
id: riscv_restore
with:
path: /opt/riscv
key: riscv-${{ env.RISCV_VERSION }}-${{ env.SCCACHE_C_CUSTOM_CACHE_BUSTER }}

- name: Setup verilator path
run: |
echo /opt/verilator/bin >> $GITHUB_PATH
- name: Setup riscv path
run: |
echo /opt/riscv/bin >> $GITHUB_PATH
- name: Run Caliptra Verilator Smoke Test
run: |
# TODO: Add the run_verilator_l0_regression.py script.
# Running a simple test to make sure that there aren't any elaboration issues
CALIPTRA_ROOT=$(pwd)
cd tools/scripts
make verilator CALIPTRA_ROOT=$CALIPTRA_ROOT TESTNAME=${{ matrix.test_name }}
make verilator CALIPTRA_ROOT=$CALIPTRA_ROOT TESTNAME=${{ matrix.test_name }} | tee output.log
# Search the last 30 lines of the output for "TESTCASE PASSED"
tail -n 30 output.log | grep "TESTCASE PASSED"
# grep will return 0 if the search term is found, and 1 otherwise
# A non-zero value will cause the github action to fail.
exit $?
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and<BR>
limitations under the License.*_<BR>

# **Caliptra Hands-On Guide** #
_*Last Update: 2023/03/16*_
_*Last Update: 2023/05/09*_


## **Tools Used** ##
Expand Down Expand Up @@ -70,20 +70,31 @@ Caliptra
| |-- Caliptra_Hardware_Spec.pdf
| |-- Caliptra_TestPlan_L1.pdf
|-- src
| |-- aes
| |-- ahb_lite_bus
| |-- csrng
| |-- datavault
| |-- doe
| |-- ecc
| |-- edn
| |-- entropy_src
| |-- hmac
| |-- hmac_drbg
| |-- integration
| |-- keyvault
| |-- kmac
| |-- lc_ctrl
| |-- libs
| |-- pcrvault
| |-- prim
| |-- prim_generic
| |-- riscv_core
| |-- sha256
| |-- sha512
| |-- sha512_masked
| |-- soc_ifc
| |-- spi_host
| |-- uart
`-- tools
|-- config
|-- README
Expand All @@ -97,12 +108,13 @@ The "Integration" sub-component contains the top-level fileset for Caliptra. `sr

## **Scripts Description** ##

`demo.rdl`:Sample RDL file<BR>
`Makefile`: Makefile to generate SRAM initialization files from test firmware and to run Verilator simulation<BR>
`run_test_makefile`: Wrapper used in Microsoft internal build flow to invoke Makefile for mem init file generation<BR>
`reg_gen.py`: Used to compile/export RDL files to register source code<BR>
`reg_gen.sh`: Wrapper used to call `reg_gen.py` for all IP cores in Caliptra<BR>
`reg_doc_gen.py`: Used to compile/export top-level RDL address map to register source code, defining complete Caliptra address space, and produces HTML documentation<BR>
`reg_doc_gen.sh`: Wrapper to invoke `reg_doc_gen.py`<BR>
`reg_json.py`:Used to import JSON register definition from OpenTitan and generate SystemRDL model<BR>
`rdl_post_process.py`: Post-processing functionality to make RDL generated SystemVerilog files compatible with lint/Verilator requirements<BR>
`run_verilator_l0_regression.py`: Wrapper to run the L0 smoke test regression suite using the Makefile flow in Verilator<BR>
`integration_vector_gen.py`: Generates test vectors for crypto core tests<BR>
Expand Down
141 changes: 141 additions & 0 deletions Release_Notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
_*SPDX-License-Identifier: Apache-2.0<BR>
<BR>
<BR>
Licensed under the Apache License, Version 2.0 (the "License");<BR>
you may not use this file except in compliance with the License.<BR>
You may obtain a copy of the License at<BR>
<BR>
http://www.apache.org/licenses/LICENSE-2.0 <BR>
<BR>
Unless required by applicable law or agreed to in writing, software<BR>
distributed under the License is distributed on an "AS IS" BASIS,<BR>
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<BR>
See the License for the specific language governing permissions and<BR>
limitations under the License.*_<BR>

# **Release Notes** #
_*Last Update: 2023/05/09*_

## Rev 0p8 ##

### DISCALIMER: This is NOT A BUG-FREE MODEL YET. This is a 0p8 release model. Please see testplan document in docs folder to know the status of validation. ###
#### This model is released mainly for interface, floorplan planning purposes for consumers. ####
#### Rev 0p8 release date: 03-31-2023 ####

- Caliptra IP Specification: see docs/ folder
- Caliptra Integration Specification: see docs/ folder
- Caliptra testplan: see docs/ folder
- CHIPALLIANCE RISC-V Core - https://github.com/chipsalliance/Cores-VeeR-EL2/
- ICCM, DCCM enabled w/ 128KB each; Instruction Cache disabled; fast interrupt redirect enabled
- Cryptos (please see the spec for NIST compliance algorithms followed)
- HMAC384 – Caliptra consortium provided (built based on SHA384 block below)
- ECC384 – Based on secp384, Caliptra consortium provided
- HMAC-DRBG – Caliptra consortium provided (but built using HMAC384 above)
- Key Vault & PCR Vault – Caliptra consortium provided
- SHA384/SHA512 – https://github.com/secworks/sha512
- Deobfuscation block – Built on https://github.com/secworks/aes but NOT ROM/FW accessible
- SHA256 – https://github.com/secworks/sha256
- Side channel attack analysis and solutions where applicable (Plz see Caliptra IP specification for details)
- AHB-lite internal fabric
- Please see spec for decoding details of various blocks
- Key Vault, PCR Vault w/ HW PCR extension & Data Vault
- Interrupts from all peripherals (Cryptos, SOC mailbox, IOs, timers etc.)
- ICCM write locking
- TAP interface
- Idle Clock Gating
- Impactless update reset
- Mailbox SRAM ECC
- Security Assert Flushing in debug unlocked & scan modes
- SOC interface (APB, mailbox, architectural registers, fuse registers, external TRNG REQ, SHA384 acceleration) – Caliptra Consortium provided
- Lint clean to the rules published in the integration spec
- HTML (generated from RDLs) for all registers (internal registers, external facing architectural registers, fuse registers)
- RTL “Frozen” IP interface; Frozen SOC facing registers.
- All changes from hereon forth will require CHIPSALLIACE CALIPTRA WG approval
- WDT, Integrated TRNG, SPI (unused in BMD/passive mode)
- Validation Notes:
- DUT per crypto block and associated checkers
- Nightly regression on crypto blocks on-going
- Smoke tests for all of the above passing including bring up/boot of the caliptra IP (KV testing for ECC & SHA)
- UVMF for multiple DUT blocks and SOC interface
- DV complete for first cut of the boot & reset flows, Fuses, SOC registers, Crypto blocks, Key vault, PCR Vault, PCR extend, PCR signing, Mailbox

## Pending for RTL 1p0: ##
- Timers, integrated-TRNG integration w/ Caliptra, Error domain logic
- Lots of bug fixes :-)
- Data Vault, TRNG REQ protocol, SHA384 acceleration, More mailbox val, PCR val, cross product flows

## Previous Releases ##

### Rev Pre0p8: ###
#### DISCLAIMER: This is NOT A BUG-FREE MODEL. This is a pre-0p8 development model that will be sync’d every week. ####
#### This model is released mainly for interface, floorplan planning purposes for consumers. ####
#### 0p8 release date = 03-31-2023 ####
- Caliptra Hardware Specification: see docs/ folder
- Caliptra Integration Specification: see docs/ folder
- Caliptra testplan: see docs/ folder
- CHIPALLIANCE RISC-V Core - https://github.com/chipsalliance/Cores-VeeR-EL2/
- ICCM, DCCM enabled w/ 128KB each; Instruction Cache disabled; fast interrupt redirect enabled
- Cryptos (please see the spec for NIST compliance algorithms followed)
- HMAC384 – Caliptra consortium provided (built based on SHA384 block below)
- ECC384 – Based on secp384, Caliptra consortium provided
- HMAC-DRBG – Caliptra consortium provided (but built using HMAC384 above)
- Key Vault & PCR Vault – Caliptra consortium provided
- SHA384/SHA512 – https://github.com/secworks/sha512
- Deobfuscation block – Built on https://github.com/secworks/aes but NOT ROM/FW accessible
- SHA256 – https://github.com/secworks/sha256
- Side channel attack analysis and solutions where applicable (Plz see Caliptra IP specification for details)
- AHB-lite internal fabric
- Please see spec for decoding details of various blocks
- Key Vault, PCR Vault w/ HW PCR extension & Data Vault
- Interrupts from all peripherals (Cryptos, SOC mailbox, IOs, timers etc.)
- ICCM write locking
- TAP interface
- Idle Clock Gating
- Impactless update reset
- Mailbox SRAM ECC
- Security Assert Flushing in debug unlocked & scan modes
- SOC interface (APB, mailbox, architectural registers, fuse registers, external TRNG REQ, SHA384 acceleration) – Caliptra Consortium provided
- Lint clean to the rules published in the integration spec
- HTML (generated from RDLs) for all registers (internal registers, external facing architectural registers, fuse registers)
- RTL “Frozen” IP interface; Frozen SOC facing registers.
- All changes from hereon forth will require CHIPSALLIACE CALIPTRA WG approval
- Validation Notes:
- DUT per crypto block and associated checkers
- Nightly regression on crypto blocks on-going
- Smoke tests for all of the above passing including bring up/boot of the caliptra IP (KV testing for ECC & SHA)
- UVMF for multiple DUT blocks and SOC interface

### Rev rtl-caliptra_rtl_0.5.1 ###
- Add missing printf/ and includes/ directories to src/integration/test_suites which are required to run the tests
- Updated Version.txt and tar.gz

### Rev rtl-caliptra_rtl_0.5rtl ###
- CHIPALLIANCE RISC-V Core - https://github.com/chipsalliance/Cores-VeeR-EL2
- ICCM, DCCM enabled w/ 128KB each; Instruction Cache disabled; fast interrupt redirect enabled
- Cryptos (please see the spec for NIST compliance algorithms followed)
- HMAC384 – Caliptra consortium provided (built based on SHA384 block below)
- ECC384 – Based on secp384, Caliptra consortium provided
- HMAC-DRBG – Caliptra consortium provided (but built using HMAC384 above)
- Key Vault & PCR Vault – Caliptra consortium provided
- SHA384/SHA512 – https://github.com/secworks/sha512
- Deobfuscation block – Built on https://github.com/secworks/aes but NOT ROM/FW accessible
- SHA256 – https://github.com/secworks/sha256
- Side channel attack analysis and solutions where applicable (Plz see Caliptra IP specification for details)
- AHB-lite internal fabric
- Please see spec for decoding details of various blocks
- Interrupts from all peripherals (Cryptos, SOC mailbox, IOs, timers etc.)
- ICCM locking
- SOC interface (APB, mailbox, architectural registers, fuse registers, TRNG REQ protocol) – Caliptra Consortium provided
- Lint clean up is partially done
- HTML (generated from RDLs) for all registers (internal registers, external facing architectural registers, fuse registers)
- Stable IP interface (pending TRNG interface wires that is a new feature)
- Validation Notes:
- DUT per crypto block and associated checkers
- Nightly regression on crypto blocks on-going
- Smoke tests for all of the above passing including bring up/boot of the caliptra IP (KV testing for ECC & SHA are pending)
- UVMF for multiple DUT blocks and SOC interface
- NOTE: 0p8 release will have stress validation on SOC interface with random resets, clock gating, impactless update crossed with mailbox protocol etc.




Loading

0 comments on commit 18e8501

Please sign in to comment.