Skip to content

Commit

Permalink
Reintegrate main -> dev-goog (#270)
Browse files Browse the repository at this point in the history
* Add test for Mailbox JTAG accesses with clock gating

Internal-tag: [#47908]

* Update on Readme

* SHA 256 final

* update on readme

* Added HMAC

* Updated coprights

* Create Security and Response policy

* Merged PR 124577: Fix WDT NMI prediction

Fixes the case where timers restart and then t2 times out in cascade mode and NMI is triggered. Expected txn needs to occur in the same clk as NMI interrupt

Related work items: #545794

* Merged PR 125379: added message reduction

added message reduction

Related work items: #554637

* Merged PR 125576: Increase WDT timer timeout value

Enforce a minimum of 5 clks on timer timeout values for WDT tests to avoid transaction mismatches

Related work items: #555119

* Merged PR 125587: KV clear prediction fix, debug x AHB sequence, convert rst cross cps to cover props

1. Emulate the 1 cycle delay in clear function
2. Add more scenarios to debug sequence
3. Rst cross coverpoints never get hit, converting to cover properties for better coverage

Related work items: #532848

* Merged PR 126129: added failure in signing if generated signature has s=0

added s_out_of_range failure for signing output
added ecc test vector for seed/nonce/iv full range

Related work items: #561868

* Merged PR 125683: Scan mode dft override and synchronizer removal

- fix for scan coverage
Removing synchronizer from scan mode signal on reset override.
Adding warm reset pin to drive reset during scan mode for max coverage.

Related work items: #555293

* Merged PR 126213: Check for pending t1 interrupt before changing timeout values in RT fw

Related work items: #562658

* Merged PR 126577: Coverage merge all duts

Pipeline to merge all duts coverage into one database

Related work items: #563789

* Merged PR 126835: Fixing +COVERAGE compiles that broke after coverage bind additions

Addition of coverage binds to top level caliptra benches broke compilation when +COVERAGE was added. Missed this due to pipeline and manual testing not includingt he option.

Related work items: #563789

* Merged PR 127057: added a missing default case to hmac_drbg_interface

added a missing default case to hmac_drbg_interface

Related work items: #565291

* Remove MSFT internal collateral files

* Merged PR 127071: UVM validation FW fix - check/clear error interrupts at MBOX flow entry

Firmware fix to clear any error interrupts held over after previous mailbox flow handling exited, but before the mailbox returned to idle state. Resolves a UVM regression edge case.

Also, force firmware randomization seed to match hardware seed by extracting seed value from the yml test file (which accounts for manual override in local runs).

Related work items: #565323

* Merged PR 127106: Fix rd_data cg instantiation

Related work items: #565386

* Merged PR 127097: More fixes to coverage merging

Fixing how coverage is merged

Related work items: #563789

* Merged PR 127448: MSFT sync: Manual file-copy from GH dev-integrate to MSFT internal repo

MSFT sync: Manual file-copy from GH dev-integrate to MSFT internal repo

Related work items: #566127

* Merged PR 127773: Adding caliptra top tb directed regression to coverage roll up

Adding coverage switches to caliptra top directed regression
Changes to coverage pipeline to roll up caliptra top directed and random regressions
Added symlink to latest merged coverage directory

Related work items: #563789

* Merged PR 127232: UVM fix for soc_ifc_rand_test deadlock edge case

Fix for multi-threaded reg accesses resulting in deadlock on uvm_reg

Related work items: #565702

* Merged PR 127980: Fixing MBOX spurious double ecc error

- removing extra pointer resets so that we don't generate spurious interrupts on unnecessary reads of dword 0
- fixing tests added to directed test list, bad path

Related work items: #567016

* Merged PR 128205: UVM regression fix for multi-agent arb issue, force_unlock deadlock issue

Fixes two issues:
- Known UVM bug (described here: https://forums.accellera.org/topic/7037-register-write-clobbers-simultaneous-access-in-multi-threaded-testbench/) that causes uvm_reg arbitration to fail (access semaphore has a bug). This causes failures during the multi-agent sequence when multiple agents are trying to access mbox_datain. Solved with an additional application-layer semaphore custom to our reg-block.
- A recent fix to solve an unreturned semaphore in the register layer (unrelated to the above) added a bug that may cause deadlock in the error injection CPTRA-side handler sequence when an error occurs.

Related work items: #566556, #567666

* Merged PR 127470: Disable timers after first timeout before NMI check

Randomized timeout values can be small enough that timer1 times out a second time before NMI testing is done in RT. The intr check helps but needs to happen just before the timer is restarted.

Related work items: #566167

* Merged PR 128247: [UVM] Fixes in val env. for several regression failures related to timeouts or Mailbox FSM edge cases

When an illegal transfer occurs concurrent with a legal mailbox interaction, the erroneous access should take precedence and flag a protocol violation instead of continuing with the normal flow.
* Bug issue: https://dev.azure.com/ms-tsd/AHA_POC/_workitems/edit/519733
* Will not fix for 1p0. Instead, this PR adds an explicit print message when the known failure scenario occurs, to aid regression review.

Add a fix for a UVM sequence-specific failure where double-bit ECC error injection can result in a timeout (by corrupting the "expected" response dlen value to a large number).

Related work items: #568733, #568736

* Merged PR 128855: [Bug fix] Mailbox rd_valid_f signal rst/init value; [UVM] validation fw fix for error intr handling

RTL fix:
- Add reset value for mbox_rd_valid_f, resolving a potential issue with mbox_dataout containing X values (resolves #250)

UVM Validation fix:
- Clear cmd_fail/inv_dev error interrupts at Mbox flow entry (val runtime firmware)

Related work items: #569091, #569460

* Remove integ spec PDF as we migrate to Markdown format

* README updates:

Add
 - firmware regression list description
 - enhance UVM run steps
 - describe test list selection
 - describe Verilog file list generation and usage

* Formatting

* Formatting

* Formatting

* Formatting

* Formatting

* README: Tool version info

* initial markdown conversion

* minor updates based on feedback

* add images and image references

* Update Caliptra_rtl.md

Adding specific signal names for flops to remove from scan chain to protect obfuscation key leakage.

* Merged PR 129340: KV debug test update and other misc items

1. KV debug test update to issue reset every time debug/scan mode is toggled
2. Update rst window assertions to disable during scan mode
3. Add common_defines to clk_gate.sv (#248)
4. Add WDT + rst test
5. WDT regression fix

Related work items: #574347, #574348

* Merged PR 130632: Remove common_defines from clk_gate

common_defines inclusion in clk_gate.sv causes compilation issues

* Merged PR 130640: Small coverage improvements and adding directed tb to merge pipeline

- cleaning up coverage merge pipeline
- updating map file for directed testbench mappings
- Adding streaming case from caliptra side for sha accelerator to hit stall condition
- Removed coverpoints that can't be hit
  - soc ifc reg doesn't stall, so ip signal isn't valid
  - Boot done -> idle arc is tied off. State is terminal

Related work items: #486758, #563789

* Merged PR 130547: UVM val FW bug fix to resolve regression failure

Do an FSM check again upon detecting error interrupt - to catch late-asserting error transition

Related work items: #575104

* Merged PR 131583: Regression test list typo fix

Fix a typo in the firmware test list providing testsuite for nightly directed regression

Related work items: #582436

* Merged PR 131385: fix for req hold bug, issue 259

fix for req hold bug, issue 259
sha mbox accesses would always assert req_hold the entire time, even if there was no conflict
fixed by qualifying the hold correctly, now soc or uc can read mbox registers without getting held

Related work items: #579190

* Merged PR 131836: Include config_defines in clk_gate

Include config_defines in clk_gate

Related work items: #583044

* Merged PR 131898: RDL register description updates and fix for UVM prediction issue

Add enhanced text descriptions for all of the error fatal/non-fatal registers and their internal mask registers that explains how the register contents and transitions are related to the assertion of output interrupt signals, cptra_error_fatal and cptra_error_non_fatal.
Add text description for CPTRA_DBG_MANUF_SERVICE_REG, which resolves github issue #261
Add a fix in the UVM class soc_ifc_predictor to correct the prediction of cptra_error_non_fatal based on triggering events instead of directly calculating the interrupt pin based on register contents.

Related work items: #583195

* Camel case for markdown docs

* Merged PR 132089: fixing wait count, worst case is actually 33 for direct read conflicts

fixing wait count, worst case is actually 33 for direct read conflicts

Related work items: #583732

* Merged PR 132153: TB Fix: soc_ifc_tb standalone test is incorrectly checking WO trigger regs.

Fix the reg stimulus/checking for WO intr blk regs (triggers)

Update the text description in register RDL files to add clarity on usage of trigger register.

Related work items: #583997

* Fix mv path

* Clarify eTRNG usage

* Language: RNG -> TRNG

* Update integ spec to 0.9 version; rollback release notes to reflect 0.9 release

* Language, simplification

* Version docs at 1.0-rc1

* Update CaliptraIntegrationSpecification.md

Updating integration parameter table to include the file where the define/parameter is present as well as updating the names to match RTL.

* Update CaliptraIntegrationSpecification.md

Moving "defines" to defines table

* RDL: Add RNG unavail bit to dbg manuf reg description (#283)

Add Random Number Generator Unavailable bit to dbg manuf register description

* Merged PR 132462: [UVM] Fix for regression failure caused by soc_ifc error injection sequence

Adjust wait methodology when pausing the rand reg access routine to avoid errant termination of the task and subsequent deadlock

Related work items: #584641

* Merged PR 133196: KV test content for coverage

Added some interleaved operations like writes to random clients during debug/scan modes, after clear/locks, etc. Earlier, only a few of the clients were being exercised. Added a task to randomly select a combination of write clients

Related work items: #586448

* Merged PR 132944: UVM val firmware bug fix: solve a possible error race condition

* In UVM validation firmware for caliptra_top, fix the mbox_unlock procedure so internal firmware interrupts in the data structure are cleared before asserting mbox_unlock. This allows subsequent errors immediately after the unlock to trigger a whole new error handling flow instead of being masked.

Related work items: #585880

* Merged PR 133433: Add SV assertions to uvmf_caliptra_top testbench

Add SV assertions to uvmf_caliptra_top testbench

Related work items: #586843

* Merged PR 133575: Remove top port TODO comments

* Remove TODO comments from the top portlist in caliptra_top
  * Resolves #284
* Fix uvmf_caliptra_top compilation with the iTRNG option by including the UVMF_CALIPTRA_TOP define (for SVA usage).
* Add generated UVM compilation file lists (.vf)
  * The compilation file lists should provide clarity regarding #265

Related work items: #587032, #587095

* Spec update with synthesis warnings and jtag tck requirement

* Added some more description

* Apply suggestion from review

* Remove accidentally placed description

* Update expected mailbox rdptr value

Internal-Tag: [#51338]
Signed-off-by: Maciej Kurc <[email protected]>

* Remove I3C interface placeholder comment (#300)

* Remove support for JTAG read IDCODE instruction from VeeR TAP

Internal-Tag: [#51306]
Signed-off-by: Maciej Kurc <[email protected]>

* Remove expected IDCODE from OpenOCD config

Internal-Tag: [#51306]
Signed-off-by: Maciej Kurc <[email protected]>

* initial markdown conversion of hardware spec

* [README] Update VCS steps (#308)

* Update VCS steps with instructions to copy test vector generator

* Add Makefile VCS sim step to copy test vector gen scripts

* Add steps for running UVM unit tests

* VCS instructions for running unit tests

* Fix VCS invocation in Makefile so that DPI functions get compiled. (#306)

Internal-Tag: [#51415]

Signed-off-by: Maciej Kurc <[email protected]>

* Merged PR 133861: Filesystem merge from caliptra-rtl GitHub to MSFT internal

Manual filesystem merge from GH repo
(Bringing back to GH to include some file modifications - lic headers)

Related work items: #587660

* Commit minor tweaks to sync infrastructure with MSFT internal repo (hand-copied)

* Merged PR 134395: KV UVM fixes

Addresses regression failures due to test setup issue and last dword clear logic

Related work items: #588795

* Merged PR 134100: Update synthesis script with FC commands

Migrate our synthesis setup to fusion compiler
NOTE: MSFT internal synthesis flow is used as a pipe-cleaner to check
for synthesizability, lint, timing. This may be different from tools
used by other Caliptra developers for more rigorous physical analysis.

Related work items: #589061

* Merged PR 134598: UVM regression fixes for soc_ifc deadlock and AHB stall

Fix three different regression errors caused by testbench bugs:
* An edge case can cause AHB interface to stall up to 34 clock cycles when running SHA accelerator operations, previous TB code flags an error above 33 clock cycles
* A multi-threaded sequence issue in the soc_ifc mailbox testcase with random register access injection can result in deadlock
* A false-positive test pass might be reported for Caliptra-initiated mailbox tests - erroneous/unexpected MBOX_ERROR transitions are handled normally, even for non-error-injection scenarios.

Related work items: #589323, #589324, #589546

* Merged PR 134981: Update kv scan sequence

Update lower level scan mode sequence to make debugUnlock input to KV a pulse instead of a level
Add some helpful prints to predictor

Related work items: #591177

* Merged PR 136182: Fix ICCM ECC error not reported

* Fix the GH issue #295, which describes a scenario where ECC errors on reads from ICCM may not trigger the error signal and cause cptra_error_fatal to assert.
* Fix a minor UVM issue in uvmf_soc_ifc that causes intermittent errors during nightly regression.

Related work items: #597603, #597604, #597607

---------

Signed-off-by: Maciej Kurc <[email protected]>
Co-authored-by: Robert Szczepanski <[email protected]>
Co-authored-by: ludwig247 <[email protected]>
Co-authored-by: tobias ludwig <[email protected]>
Co-authored-by: Lou Ferraro <[email protected]>
Co-authored-by: Kiran Upadhyayula <[email protected]>
Co-authored-by: Mojtaba Bisheh Niasar <[email protected]>
Co-authored-by: Michael Norris <[email protected]>
Co-authored-by: Piotr Kwidzinski <[email protected]>
Co-authored-by: bharatpillilli <[email protected]>
Co-authored-by: steph-morton <[email protected]>
Co-authored-by: Andres Lagar-Cavilla <[email protected]>
Co-authored-by: Michael Norris <[email protected]>
Co-authored-by: Andres Lagar-Cavilla <[email protected]>
Co-authored-by: Kiran Upadhyayula <[email protected]>
Co-authored-by: Maciej Kurc <[email protected]>
Co-authored-by: mcockrell-google <[email protected]>
Co-authored-by: Karol Gugala <[email protected]>
  • Loading branch information
18 people authored Dec 5, 2023
1 parent 147774f commit 78bbb29
Show file tree
Hide file tree
Showing 212 changed files with 13,568 additions and 1,466 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/interactive-debugging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,19 @@ jobs:
${CALIPTRA_ROOT}/.github/scripts/openocd_test.sh \
-f board/caliptra-verilator-rst.cfg \
-f ${CALIPTRA_ROOT}/src/integration/test_suites/infinite_loop/peripheral_access.tcl
- name: Build Verilated simulation
run: |
export CALIPTRA_ROOT=$(pwd)
rm -rf run/*
make -C run -f ${CALIPTRA_ROOT}/tools/scripts/Makefile verilator-build TESTNAME=infinite_loop DEBUG_UNLOCKED=1 \
OBJCACHE="" CC=gcc CXX=g++ LINK=g++
make -C run -f ${CALIPTRA_ROOT}/tools/scripts/Makefile program.hex TESTNAME=infinite_loop
- name: Test JTAG access with clock gating
run: |
export CALIPTRA_ROOT=$(pwd)
cd run
${CALIPTRA_ROOT}/.github/scripts/openocd_test.sh \
-f board/caliptra-verilator.cfg \
-f ${CALIPTRA_ROOT}/src/integration/test_suites/infinite_loop/jtag_cg.tcl
119 changes: 102 additions & 17 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/09/06*_
_*Last Update: 2023/10/17*_


## **Tools Used** ##
Expand All @@ -37,10 +37,12 @@ Simulation:
- `Version 2021.2.1` of AHB/APB models
- UVM installation
- `Version 1.1d`
- Mentor Graphics UVM-Frameworks
- `2022.3`

Synthesis:
- Synopsys DC
- `Version 2020.09-SP1`
- Synopsys Fusion Compiler
- `Version 2022.12-SP3`

GCC:
- RISCV Toolchain for generating memory initialization files
Expand All @@ -53,7 +55,7 @@ Other:
- Playbook (Microsoft Internal workflow management tool)

### **RISCV Toolchain installation** ###
Note that there is significant configurability when installing the RISCV toolchain.
There is significant configurability when installing the RISCV toolchain.
These instructions may be used to create a RISCV installation that will be compatible
with the provided Makefile for compiling test C programs.

Expand All @@ -72,7 +74,7 @@ Required for simulation:<BR>
`CALIPTRA_ROOT`: Defines the absolute path to the Project repository root (called "Caliptra" or "caliptra-rtl"). Recommended to define as `${CALIPTRA_WORKSPACE}/Caliptra`.<BR>

Required for Firmware (i.e. Test suites) makefile:<BR>
`TESTNAME`: Contains the name of one of the tests listed inside the `src/integration/test_suites` folder<BR>
`TESTNAME`: Contains the name of one of the tests listed inside the `src/integration/test_suites` folder; only used for `caliptra_top_tb` tests<BR>

## **Repository Overview** ##
```
Expand Down Expand Up @@ -121,6 +123,9 @@ VF files provide absolute filepaths (prefixed by the `CALIPTRA_ROOT` environment
The "Integration" sub-component contains the top-level fileset for Caliptra. `src/integration/config/compile.yml` defines the required filesets and sub-component dependencies for this build target. All of the files/dependencies are explicitly listed in `src/integration/config/caliptra_top_tb.vf`. Users may compile the entire design using only this VF filelist.<BR>


## **Verilog File Lists** ##
Verilog file lists are generated via VCS and included in the config directory for each unit. New files added to the design should be included in the vf list. They can be included manually or by using VCS to regenerate the vf file. File lists define the compilation sources (including all dependencies) required to build and simulate a given module or testbench, and should be used for simulation, lint, and synthesis.

## **Scripts Description** ##

`demo.rdl`:Sample RDL file<BR>
Expand All @@ -138,21 +143,32 @@ The "Integration" sub-component contains the top-level fileset for Caliptra. `sr

## **Simulation Flow** ##

### VCS Steps: ###
### Caliptra Top VCS Steps: ###
1. Setup tools, add to PATH (ensure riscv64-unknown-elf-gcc is also available)
2. Define all environment variables above
- For the initial test run after downloading repository, `iccm_lock` is recommended for TESTNAME
- See [Regression Tests](#Regression-Tests) for information about available tests.
3. Create a run folder for build outputs (and cd to it)
4. [OPTIONAL] By default, this run flow will use the riscv64 toolchain to compile test firmware (according to TESTNAME) into program.hex, iccm.hex, dccm.hex, and mailbox.hex. As a first pass, integrators may alternatively use the pre-built hexfiles for convenience (available for `iccm_lock` test). To do this, copy `iccm_lock.hex` to the run directory and rename to `program.hex`. `dccm.hex` should also be copied to the run directory, as-is. Use `touch iccm.hex mailbox.hex` to create empty hex files, as these are unnecessary for `iccm_lock` test.
4. [OPTIONAL] By default, this run flow will use the riscv64 toolchain to compile test firmware (according to TESTNAME) into program.hex, iccm.hex, dccm.hex, and mailbox.hex. As a first pass, integrators may alternatively use the pre-built hexfiles for convenience (available for [iccm_lock](src/integration/test_suites/iccm_lock) test). To do this, copy [iccm_lock.hex](src/integration/test_suites/iccm_lock/iccm_lock.hex) to the run directory and rename to `program.hex`. [dccm.hex](src/integration/test_suites/iccm_lock/iccm_lock.hex) should also be copied to the run directory, as-is. Use `touch iccm.hex mailbox.hex` to create empty hex files, as these are unnecessary for `iccm_lock` test.
5. Invoke `${CALIPTRA_ROOT}/tools/scripts/Makefile` with target 'program.hex' to produce SRAM initialization files from the firmware found in `src/integration/test_suites/${TESTNAME}`
- E.g.: `make -f ${CALIPTRA_ROOT}/tools/scripts/Makefile program.hex`
- NOTE: TESTNAME may also be overridden in the makefile command line invocation, e.g. `make -f ${CALIPTRA_ROOT}/tools/scripts/Makefile TESTNAME=iccm_lock program.hex`
6. Compile complete project using `src/integration/config/caliptra_top_tb.vf` as a compilation target in VCS. When running the `vcs` command to generate simv, users should ensure that `caliptra_top_tb` is explicitly specified as the top-level component in their command to ensure this is the sole "top" that gets simulated.
7. Simulate project with `caliptra_top_tb` as the top target
7. Copy the test generator scripts to the run output directory:
- [src/ecc/tb/ecdsa_secp384r1.exe](src/ecc/tb/ecdsa_secp384r1.exe)
* Necessary for [randomized_pcr_signing](src/integration/test_suites/randomized_pcr_signing)
* OPTIONAL otherwise
- [src/doe/tb/doe_test_gen.py](src/doe/tb/doe_test_gen.py)
* Allows use of randomized secret field inputs during testing.
* Required when using the `+RAND_DOE_VALUES` plusarg during simulation
* Also required for several smoke tests that require randomized DOE IV, such as smoke_test_doe_scan, smoke_test_doe_rand, smoke_test_doe_cg
8. Simulate project with `caliptra_top_tb` as the top target

### Verilator Steps: ###
### Caliptra Top Verilator Steps: ###
1. Setup tools, add to PATH (ensure Verilator, GCC, and riscv64-unknown-elf-gcc are available)
2. Define all environment variables above
- For the initial test run after downloading repository, `iccm_lock` is recommended for TESTNAME
- See [Regression Tests](#Regression-Tests) for information about available tests.
3. Create a run folder for build outputs
- Recommended to place run folder under `${CALIPTRA_WORKSPACE}/scratch/$USER/verilator/<date>`
4. [OPTIONAL] By default, this run flow will use the riscv64 toolchain to compile test firmware (according to TESTNAME) into program.hex, iccm.hex, dccm.hex, and mailbox.hex. As a first pass, integrators may alternatively use the pre-built hexfiles for convenience (available for `iccm_lock` test). To do this, copy `iccm_lock.hex` to the run directory and rename to `program.hex`. `dccm.hex` should also be copied to the run directory, as-is. Use `touch iccm.hex mailbox.hex` to create empty hex files, as these are unnecessary for `iccm_lock` test.
Expand All @@ -170,6 +186,18 @@ The "Integration" sub-component contains the top-level fileset for Caliptra. `sr
3. NOTE: The script automatically creates run output folders at `${CALIPTRA_WORKSPACE}/scratch/$USER/verilator/<timestamp>/<testname>` for each test run
4. NOTE: The output folder is populated with a run log that reports the run results and pass/fail status

### Unit Test VCS Steps: ###
1. Setup tools, add to PATH
1. Define all environment variables above
1. Create a run folder for build outputs (and cd to it)
1. Compile complete project using `src/<block>/config/<name>_tb.vf` as a compilation target in VCS. When running the `vcs` command to generate simv, users should ensure that `<name>_tb` is explicitly specified as the top-level component in their command to ensure this is the sole "top" that gets simulated.
1. Copy the test generator scripts or test vectors to the run output directory:
- [src/ecc/tb/test_vectors/mm_test_vectors\*.hex](src/ecc/tb/test_vectors)
* Necessary for [ecc_montgomerymultiplier_tb](src/ecc/tb/ecc_montgomerymultiplier_tb.sv)
- [src/sha256/tb/sha256_test_gen.py](src/sha256/tb/sha256_test_gen.py)
* Necessary for [sha256_random_test](src/sha256/tb/sha256_random_test.sv)
1. Simulate project with `<name>_tb` as the top target

### UVM Testbench Steps for `caliptra_top`: <BR>

**Description**:<BR>
Expand All @@ -178,20 +206,77 @@ The UVM Framework generation tool was used to create the baseline UVM testbench
**Prerequisites**:<BR>
- QVIP 2021.2.1 for Mentor Graphics (provides the AHB/APB VIP)
- UVM 1.1d installation
- Mentor Graphics UVM-Framework installation

Steps:<BR>
1. Compile UVM 1.1d library
2. Compile the AHB/APB QVIP source
3. Compile the UVMF wrapper for APB/AHB in Caliptra/src/libs/uvmf
4. Compile the `verification_ip` provided for `soc_ifc` found in `Caliptra/src/soc_ifc/uvmf_soc_ifc`
5. Compile the `caliptra_top` testbench found in `Caliptra/src/integration/uvmf_caliptra_top`
6. `Caliptra/src/integration/uvmf_caliptra_top/uvmf_template_output/project_benches/caliptra_top/tb/testbench/hdl_top.sv` is the top-level TB wrapper for the system
7. Select a test to run from the set of tests in `Caliptra/src/integration/uvmf_caliptra_top/uvmf_template_output/project_benches/caliptra_top/tb/tests/src`
8. Provide `+UVM_TESTNAME=<test>` argument to simulation
1. Compile the AHB/APB QVIP source
1. Compile the Mentor Graphics UVM-Frameworks base library
1. Compile the UVMF wrapper for APB/AHB in Caliptra/src/libs/uvmf
1. Compile the `verification_ip` provided for `soc_ifc` found in `Caliptra/src/soc_ifc/uvmf_soc_ifc`
1. Compile the `caliptra_top` testbench found in `Caliptra/src/integration/uvmf_caliptra_top`
1. ALL compilation steps may be completed by using the file-list found at `src/integration/uvmf_caliptra_top/config/uvmf_caliptra_top.vf`
1. NOTE: `Caliptra/src/integration/uvmf_caliptra_top/uvmf_template_output/project_benches/caliptra_top/tb/testbench/hdl_top.sv` is the top-level TB wrapper for the system
1. Compile the validation firmware (as described in [Regression Tests](#Regression-Tests)) that will run on Caliptra's embedded RISC-V core
- The expected output products are `program.hex`, `caliptra_fmc.hex`, `caliptra_rt.hex` and must be placed in the simulation run directory
- `make -f ${CALIPTRA_ROOT}/tools/scripts/Makefile TESTNAME=caliptra_top program.hex`
- `make -f ${CALIPTRA_ROOT}/tools/scripts/Makefile TESTNAME=caliptra_fmc caliptra_fmc.hex`
- `make -f ${CALIPTRA_ROOT}/tools/scripts/Makefile TESTNAME=caliptra_rt caliptra_rt.hex`
1. Copy the test vectors to the run output directory:
- [src/sha512/tb/vectors/SHA\*.rsp](src/sha512/tb/vectors/)
* Required for SHA512 UVM unittest
1. Select a test to run from the set of tests in `Caliptra/src/integration/uvmf_caliptra_top/uvmf_template_output/project_benches/caliptra_top/tb/tests/src`
1. Provide `+UVM_TESTNAME=<test>` argument to simulation

### UVM Unit Test Steps: <BR>

**Description**:<BR>
The UVM Framework generation tool was used to create the baseline UVM testbench for verification of each IP component inside Caliptra. The following IP blocks have supported UVM testbenches:
- [ECC](src/ecc/uvmf_ecc)
- [HMAC](src/hmac/uvmf_2022)
- [SHA512](src/sha512/uvmf_sha512)
- [KeyVault](src/keyvault/uvmf_kv)
- [PCRVault](src/pcrvault/uvmf_pv)
- [SOC_IFC](src/soc_ifc/uvmf_soc_ifc)

**Prerequisites**:<BR>
- QVIP 2021.2.1 for Mentor Graphics (provides the AHB/APB VIP)
- UVM 1.1d installation
- Mentor Graphics UVM-Framework installation

Steps:<BR>
1. Compile UVM 1.1d library
1. Compile the AHB/APB QVIP source
1. Compile the Mentor Graphics UVM-Frameworks base library
1. Compile the UVMF wrapper for APB/AHB in Caliptra/src/libs/uvmf
1. Compile the `verification_ip` provided for the target testbench
1. ALL compilation steps may be completed by using the file-list found at `src/<block>/uvmf_<name>/config/<name>.vf`
1. NOTE: `Caliptra/src/<block>/uvmf_<name>/uvmf_template_output/project_benches/<block>/tb/testbench/hdl_top.sv` is the top-level TB wrapper for the system
1. Copy the test generator scripts to the run output directory:
- [src/ecc/tb/ecdsa_secp384r1.exe](src/ecc/tb/ecdsa_secp384r1.exe)
* Necessary for ECC unittest
- [src/hmac/tb/test_gen.py](src/hmac/tb/test_gen.py)
* Required for uvmf_hmac unittest
- [src/sha512/tb/vectors/SHA\*.rsp](src/sha512/tb/vectors/)
* Required for SHA512 UVM unittest
1. Select a test to run from the set of tests in `Caliptra/src/<block>/uvmf_<name>/uvmf_template_output/project_benches/<block>/tb/tests/src`
1. Provide `+UVM_TESTNAME=<test>` argument to simulation


## **Regression Tests** ##

Only tests from the L0 Regression List should be run.
### Standalone SystemVerilog Testbench Regression ###
Only tests from the L0 Regression List should be run.
The list is defined in the file [L0_regression.yml](https://github.com/chipsalliance/caliptra-rtl/blob/main/src/integration/stimulus/L0_regression.yml)

### UVM Regression ###
The UVM simulation environment for `caliptra_top` uses a special set of validation firmware to generate stimulus as required for the test plan. This firmware suite is found in `src/integration/test_suites` and includes:
- `caliptra_top`: A C-based program that emulates a minimal set of bringup functions similar to the function of the ROM. This C file transitions very early to either a the FMC image or Runtime image based on bringup (reset reason) conditions.
- `caliptra_fmc`: A C-based program that emulates the functionality of the First Mutable Code. In this reduced-functionality validation implementation, the FMC code is a simple intermediary that runs from ICCM and serves to boot the Runtime Firmware.
- `caliptra_rt`: A C-based program that emulates the functionality of the production Runtime code. This program receives and services interrupts, defines a minimal Non-Maskable Interrupt handler, generates FW resets as needed, processes mailbox commands (generated through the UVM validation test plan), and runs some baseline Watchdog Timer testing.

These three programs are designed to be run within the context of a UVM simulation, and will fail to generate meaningful stimulus in the standalone `caliptra_top_tb` test.

## **NOTES** ##

* The internal registers are auto rendered at the [GitHub page](https://chipsalliance.github.io/caliptra-rtl/main/internal-regs)
Expand Down
6 changes: 3 additions & 3 deletions Release_Notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and<BR>
limitations under the License.*_<BR>

# **Release Notes** #
_*Last Update: 2023/09/13*_
_*Last Update: 2023/11/02*_

## Rev 1p0 ##
## Rev 1p0-rc1 ##

### Rev 1p0 release date: (pending ROM release for official declaration) ###
### Rev 1p0-rc1 release date: 2023/11/03 (1p0 version pending ROM release for official declaration) ###
- Caliptra IP Specification: see docs/ folder
- Caliptra Integration Specification: see docs/ folder
- Caliptra testplan: see docs/ folder
Expand Down
3 changes: 3 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Caliptra Project Security Incident Response

Please refer to the security policy at [Caliptra security policy](https://github.com/chipsalliance/caliptra/security/policy).
Loading

0 comments on commit 78bbb29

Please sign in to comment.