forked from lowRISC/opentitan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchip_testplan.hjson
3588 lines (3232 loc) · 161 KB
/
chip_testplan.hjson
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
{
name: "chip"
// TODO: remove the common testplans if not applicable
import_testplans: [
"hw/dv/tools/dvsim/testplans/csr_testplan.hjson",
// TODO #5484, comment these 2 lines out because spi host memory is dummy
// "hw/dv/tools/dvsim/testplans/mem_testplan.hjson",
// Integrity error is tested in a SW test.
"hw/dv/tools/dvsim/testplans/tl_device_access_types_wo_intg_testplan.hjson",
"hw/ip/tlul/data/tlul_testplan.hjson",
"sw/device/silicon_creator/rom/data/rom_e2e_testplan.hjson",
"hw/top_earlgrey/data/chip_conn_testplan.hjson",
// IP block specific top level test plans.
"hw/top_earlgrey/data/ip/chip_kmac_testplan.hjson",
]
testpoints: [
///////////////////////////////////////////////////////////////////////////
// IO Peripherals //
// UART, GPIO, I2C, SPIDEV, SPIHOST, USB, PINMUX & PADCTRL, PATTGEN, PWM //
///////////////////////////////////////////////////////////////////////////
// UART (pre-verified IP) integration tests:
{
name: chip_sw_uart_tx_rx
desc: '''Verify transmission of data over the TX and RX port.
SW test sends a known payload over the TX port. The testbench, at the same time
sends a known payload over RX. On reception, both payloads are checked for integrity.
SW validates the reception of TX watermark, RX watermark, and the TX empty interrupts.
Choosing the max supported baud rate for the UART is sufficient.
Verify each UART instance at the chip level independently. Verify there is no aliasing
on all UART ports across the instances.
'''
stage: V1
tests: ["chip_sw_uart_tx_rx"]
tags: ["gls"]
}
{
name: chip_sw_uart_rx_overflow
desc: '''Verify the RX overflow interrupt.
The testbench sends a random payload of size greater than the RX fifo size (32). The SW
ignores the received the data to allow the RX overflow interrupt to assert.
Verify each UART instance at the chip level independently. Verify there is no aliasing
on all UART ports across the instances.
'''
stage: V1
tests: ["chip_sw_uart_tx_rx", "chip_sw_uart_tx_rx_idx1", "chip_sw_uart_tx_rx_idx2",
"chip_sw_uart_tx_rx_idx3"]
}
{
name: chip_sw_uart_rand_baudrate
desc: '''Verify UART transmission of data at various speeds.
Randomly pick one of the UART instances and configure it to run with any of these baud
rates - 9600bps, 115200bps, 230400bps, 128Kbps, 256Kbps, 1Mkbps, 1.5Mkbps.
'''
stage: V1
tests: ["chip_sw_uart_rand_baudrate"]
}
{
name: chip_sw_uart_tx_rx_alt_clk_freq
desc: '''Verify the transmission of UART via using external clock as uart core clock.
Extend from chip_sw_uart_rand_baudrate with following added settings.
- Configure LC to RMA state, so that it allows clkmgr to use external clock.
- Configure clkmgr to select external clock.
- Randomize `HI_SPEED_SEL`, so that uart core clock frequency can be either
ext_clk_freq / 4 or ext_clk_freq / 2.
'''
stage: V1
tests: ["chip_sw_uart_tx_rx_alt_clk_freq", "chip_sw_uart_tx_rx_alt_clk_freq_low_speed"]
}
// GPIO (pre-verified IP) integration tests:
{
name: chip_sw_gpio_out
desc: '''Verify GPIO outputs.
SW test configures the GPIOs to be in the output mode. The test walks a 1 through the
pins. The testbench checks the value for correctness and verifies that there is no
aliasing between the pins.
'''
stage: V1
tests: ["chip_sw_gpio"]
}
{
name: chip_sw_gpio_in
desc: '''Verify GPIO inputs.
The SW test configures the GPIOs to be in input mode. The testbench walks a 1 through
the pins. SW test ensures that the GPIO values read from the CSR is correct.
'''
stage: V1
tests: ["chip_sw_gpio"]
}
{
name: chip_sw_gpio_irq
desc: '''Verify GPIO interrupts.
The SW test configures the GPIOs to be in input mode and enables all of them to generate
an interrupt. The testbench walks a 1 through the pins. SW test ensures that the
interrupt corresponding to the right pin is seen.
'''
stage: V1
tests: ["chip_sw_gpio"]
}
// SPI_DEVICE (pre-verified IP) integration tests:
{
name: chip_sw_spi_device_tx_rx
desc: '''Verify the transmission of data on the chip's SPI device port in firmware mode with
single mode.
- The testbench sends a known payload over the chip's SPI device input port.
- The SW test, at the same time sends a known payload out over the chip's SPI device
output port.
- On reception, both payloads are checked for integrity.
- SW validates the reception of RX fifo full, RX fifo over level, TX fifo under level,
RX overflow and TX underflow interrupts.
- Run with min (6MHz), typical (30-48Mhz) and max(48MHz) SPI clk frequencies.
should use
- Also, ensure that the spi_device does not receive transactions when the csb is high.
- TODO, consider to test this mode with a real use case. The actual use case of this
mdoe is not clear right now.
'''
stage: V2
tests: ["chip_sw_spi_device_tx_rx"]
}
{
name: chip_sw_spi_device_flash_mode
desc: '''Verify the SPI device in flash mode.
- SW puts the SPI device in flash mode
- Load a firmware image (bootstrap) through flash commands to the spi_device memory.
- SW verifies the integrity of the image upon reception by reading the spi_device
memory.
- Ensure the image is executed correctly
'''
stage: V2
tests: ["chip_sw_uart_tx_rx_bootstrap"]
}
{
name: chip_sw_spi_device_pass_through
desc: '''Verify the pass through mode from an end-to-end perspective.
- Configure the SPI device and host in pass through mode.
- Program the cmd_filter_* CSRs to filter out random commands.
- Configure and enable both spi_host0 and spi_host1
- Send a random flash commands over the SPI device interface (chip IOs) from the
testbench.
- Verify the flash commands which pass through spi_host0, are received on chip IOs.
- Verify that only the payloads that are not filtered show up on the SPI host interface
at chip IOs.
- Verify spi_host1 doesn't send out any data from spi_device
- Run with min (6MHz), typical (24Mhz) and max (30MHz) SPI clk frequencies.
- Run with single, dual and quad SPI modes.
- Testbench should test the following commands:
- Read Normal, Fast Read, Fast Dual, Fast Quad, Chip Erase, Program
'''
stage: V2
tests: ["chip_sw_spi_device_pass_through"]
}
{
name: chip_sw_spi_device_pass_through_flash_model
desc: '''Verify the command filtering mechanism in passthrough mode.
- Extend the chip_spi_device_pass_through test.
- Connect with a real flash model on spi_host
- Verify that the flash commands are received and interpreted correctly in the flash
model
'''
stage: V3
tests: []
}
{
name: chip_sw_spi_device_pass_through_collision
desc: '''Verify the collisions on driving spi_host is handled properly.
- Enable upload related interrupts and configure the spi_device in passthrough mode.
- Configure a command slot to enable upload for a flash program/erase command.
- Excecute two parallel threads:
1. SPI host agent.
- Send this command via an upstream SPI host agent, then the agent keeps sending
read_status to poll the busy bit.
- When the busy bit is low, issue a read command to read data from the downstream
SPI port, and check data correctness.
2. A SW process.
- SW receives an upload interrupt and reads the command in the upload fifo to check.
- SW configures the SPI host that shows the same downstream port, to send the
uploaded command to the downstream SPI port.
- SW clears busy bit to allow the upstream SPI host to proceed to the next command.
'''
stage: V2
tests: ["chip_sw_spi_device_pass_through_collision"]
}
{
name: chip_sw_spi_device_tpm
desc: '''Verify the basic operation of the spi tpm mode.
- The testbench sends a known payload over the chip's SPI device tpm input port.
- The testbench sends a read command.
- The software test should playback the data received in the write command as the read
response.
- The testbench should check if the written and read data match.
'''
stage: V2
tests: ["chip_sw_spi_device_tpm"]
}
{
name: chip_sw_spi_device_output_when_disabled_or_sleeping
desc: '''Verify spi_device output values when spi_device is disabled or the chip is sleeping.
SW needs to be able to set the SPI output value when spi_device is disabled or the
chip is sleeping, to either all-zeros or all-ones, depending on integration
requirements. The following scenarios have to be verified:
After power-on reset:
- SW to configure pinmux retention logic so that the chip pins connected to
spi_device outputs are (a) always zero or (b) always one (SW needs to be able to
choose between a and b).
- DV environment to check that SPI outputs match configuration by SW.
Going to sleep:
- SW to disable spi_device, wait until CSb is high, configure pinmux retention logic
as it would after POR, and put chip to sleep.
- DV environment to check that SPI outputs match configuration by SW.
Wake up from sleep:
- DV environment to wake chip from sleep.
- SW to enable spi_device and disable retention logic.
- DV environment to check that SPI transactions work as usual.
'''
stage: V3
tests: []
}
// SPI_HOST (pre-verified IP) integration tests:
{
name: chip_sw_spi_host_tx_rx
desc: '''Verify the transmission of data on the chip's SPI host port.
- Program the SPI host to send a known payload out of the chip on the SPI host ports.
- The testbench receives the payload and plays it back to the SPI host interface.
- The SW verifies the sent payload matches the read response and services SPI event
interrupts.
- Run with min and max SPI clk frequencies and with single, dual and quad SPI modes.
Verify all SPI host instances in the chip.
'''
stage: V2
tests: ["chip_sw_spi_host_tx_rx"]
}
// I2C (pre-verified IP) integration tests:
{
name: chip_sw_i2c_host_tx_rx
desc: '''Verify the transmission of data over the chip's I2C host interface.
- Program the I2C to be in host mode.
- The SW test writes a known payload over the chip's I2C host interface, which is
received by the testbench.
- The testbench then loops this data back to the chip's I2C host and exercises the
read interface.
- SW validates the reception of FMT watermark and trans complete interrupts.
- SW validates that the data read matches the original data written.
- Verify the virtual / true open drain capability.
Verify all instances of I2C in the chip.
'''
stage: V2
tests: ["chip_sw_i2c_host_tx_rx",
"chip_sw_i2c_host_tx_rx_idx1",
"chip_sw_i2c_host_tx_rx_idx2"]
}
{
name: chip_sw_i2c_device_tx_rx
desc: '''Verify the transmission of data over the chip's I2C device interface.
- Program the I2C to be in device mode.
- The testbench writes a known payload over the chip's I2C device interface, which is
received and verified by the SW test for correctness.
- The testbench reads and verifies a known payload over the chip's I2C device interface,
- SW validates the reception of tx empty and trans complete interrupts.
- Verify the virtual / true open drain capability.
Verify all instances of I2C in the chip.
'''
stage: V2
tests: ["chip_sw_i2c_device_tx_rx"]
}
// USB (pre-verified IP) integration tests:
{
name: chip_sw_usbdev_dpi
desc: '''Sketch of USBDPI integration.
'''
stage: V2
tests: ["chip_sw_usbdev_dpi"]
}
{
name: chip_sw_usb_fs_tx_rx
desc: '''Verify the transmission of single-ended data over the USB at full speed. As a part of
this test, the enablement of USB pullup is also expected to be verified.
- Set `tx_differential_mode` to single-ended and `rx_differential_mode` to
differential. The other modes are not supported in OpenTitan.
- configure Link state to `Active`.
- Send and receive packets to fill the entire buffer. Ensure all the packets are
correct.
- Check interrupts (connected, pkt_received, pkt_sent, av_empty, rx_full) are triggered
correcly.
'''
stage: V3
tests: ["chip_sw_usbdev_stream"]
}
{
name: chip_sw_usb_vbus
desc: '''Verify that the USB device can detect the presence of VBUS from the USB host.
- This test extends from `chip_usb_fs_df_tx_rx`, add below at the end of the sequence.
- VBUS is controlled by SW, through programming CSRs (`override_pwr_sense_en` and
`override_pwr_sense_val`) to connect / disconnect the USB.
- Disconnect the USB to trigger `disconnected` interrupt.
- Then reconnect it and check the `connected` interrupt.
- Re-enable data transfer and ensure data correctness.
- Observe valid reference pulse usb_ref_val/pulse_o.
'''
stage: V3
tests: []
}
{
name: chip_sw_usb_suspend
desc: '''Verify that the USB device can detect the presence of VBUS from the USB host.
- This test extends from `chip_usb_fs_df_tx_rx`, add below at the end of the sequence.
- Configure USB device to enter `Suspend` state and ensure `link_suspend` interrupt is
triggered.
- Test these 2 power modes.
- Normal sleep:
- Configure pwrmgr to enter normal sleep mode, then clocks are disable while powers
are kept on.
- Resume the device through pinmux and check the `link_resume` interrupt.
- Ensure that previously enumerated information is kept.
- Deep sleep:
- Before entering deep sleep, store previously enumerated information in retention
RAM. (optional)
- Configure pwrmgr to enter deep sleep mode, and powers are turned off.
- Resume the device through pinmux and check the `link_resume` interrupt.
- Ensure that previously enumerated information and configuration (non-default
values) are wiped, as USB has been reset before wakeup.
- Restore previously enumerated information (if it's stored) or re-enumerate the
USB.
- Re-enable data transfer and ensure data correctness.
'''
stage: V3
tests: []
}
{
name: chip_usb_sof
desc: '''Verify that USB can detect SOF and respond with `usb_ref_pulse_o` and
`usb_ref_val_o`.
- Configure to enable `usb_ref_disable`.
- Send a frame with the same frame number as the USB device to trigger `frame`
interrupt.
- Ensure `usb_ref_pulse_o` and `usb_ref_val_o` behave correctly.
- Stop sending any frame and check the `host_lost` interrupt. Ensure `use_ref_*` behave
correctly.
'''
stage: V3
tests: []
}
{
name: chip_usb_wake_debug
desc: '''Verify that `usb_state_debug_i` can be read from the CSR.
- Drive random value on `usb_state_debug_i`.
- Ensure the CSR `wake_debug` returns correctly value.
'''
stage: V3
tests: []
}
{
name: chip_usb_enumeration
desc: '''Verify USB enumeration. Details are not clear.
- TODO
'''
stage: V3
tests: []
}
// PINMUX & PADRING (pre-verified IP) integration tests:
{
name: chip_pin_mux
desc: '''Verify the MIO muxing at input and output sides.
- Enable `stub_cpu` mode.
- Add a forcing interface to pinmux's pad-facing DIO and MIO ports, including the output
enables; and a sampling interface for the peripheral facing DIO and MIO ports.
- Similarly, add a driving / sampling interface for all DIOs and MIOs at the chip pads.
- In the output direction:
- Program all MIO outsel and pad attribute registers to random values.
- Force the pad-facing pinmux MIO ports and output enables to random values.
- Verify all MIO pad values for correctness.
- For the input direction:
- Program all MIO insel and pad attribute registers to random values.
- Drive the MIO pads to random values.
- Probe and sample the peripheral facing MIO ports of the pinmux and verify the values
for correctness.
- Follow a similar testing procedure for DIOs.
'''
stage: V2
tests: ["chip_padctrl_attributes"]
}
{
name: chip_padctrl_attributes
desc: '''Verify pad attribute settings for all MIO and DIO pads.
- Follow the same procedure as the `chip_pin_mux` test, ensuring the padctrl attribute
registers for all MIOs and DIOs are also randomized when verifying the outcomes.
- Verify weak pull enable, output inversion and virtual open drain and drive strength
(bit 0) signaling in the output direction.
- Verify weak pull enable and input inversion in the input direction.
- Verify multiple pad attributes for each pad set at the same time through
randomization.
Cross-references the `chip_pin_mux` test.
'''
stage: V2
tests: ["chip_padctrl_attributes"]
}
{
name: chip_sw_sleep_pin_mio_dio_val
desc: '''Verify the MIO output values in any sleep states.
- Pick between normal sleep and deep sleep randomly
- Pick between tie-0, tie-1, or High-Z randomly for all muxed,
dedicated outputs coming from non-AON IPs.
SW programs the MIO OUTSEL CSRs to ensure that in sleep it randomly picks
between tie-0, tie-1 or hi-Z for all muxed outputs coming from non-AON IPs. If an AON
peripheral output is muxed, then that peripheral's output is selected to ensure in deep
sleep the peripheral can continue its signaling even in deep sleep. The testbench
verifies the correctness of the reflected values once the chip goes into deep sleep.
This is replicated for DIO pins as well.
In this test, passthrough feature is not tested. The feature is
covered in other tests such as chip_sw_sleep_pwm_pulses.
'''
stage: V2
tests: ["chip_sw_sleep_pin_mio_dio_val"]
}
{
name: chip_sw_sleep_pin_wake
desc: '''Verify pin wake up from any sleep states.
Verify one of the 8 possible MIO or DIO pad inputs (randomly configured) can cause the
chip to wake up from sleep state. Verifying wake on posedge is sufficient for the chip
level integration testing. Upon wake up, SW reads the wake cause CSR to verify
correctness.
For V3, enhance this test to configure all wakeup detectors rather than configure only
one, then have the host randomly pick one of the IOs configured for wakeup in one of
those detectors. Also, randomize and test all wakeup modes and enable debounce filter.
'''
stage: V2
tests: ["chip_sw_sleep_pin_wake"]
}
{
name: chip_sw_sleep_pin_retention
desc: '''Verify the retention logic in pinmux that is activated during deep sleep.
- Pick a pin (such as GPIO0) and enable it in output mode. Set a known value to it (0 or
1) and verify the correctless of the value on the chip IO.
- Program the pin's retention value during deep sleep to be opposite of the active power
value programmed in the previous step.
- Reuse an existing deep sleep / low power wake up test, such as
`chip_sw_sleep_pin_wake` test to enter low power.
- Once the chip enters the deep sleep state, verify that this pin holds the correct
retention value throughout the low power state.
- Wake up the chip from sleep using the chosen method.
- Verify the pin value at the chip IOs is no longer holding the retention value once the
chip is back in active power.
'''
stage: V2
tests: ["chip_sw_sleep_pin_retention"]
}
{
name: chip_sw_tap_strap_sampling
desc: '''Verify tap accesses in different LC states.
Verify pinmux can select the life_cycle, RISC-V, and DFT taps after reset.
Verify that in TEST_UNLOCKED* and RMA states, pinmux can switch between the three TAPs
without issuing reset.
Verify in PROD state, only the LC tap can be selected.
Verify in DEV state, only the LC tap and RISC-V taps can be selected.
Verify DFT test mode straps are sampled and output to AST via
top_earlgrey.dft_strap_test_o in TEST_UNLOCKED* and RMA states.
Verify top_earlgrey.dft_strap_test_o is always 0 in the states other than TEST_UNLOCKED*
and RMA, regardless of the value on DFT SW straps.
Verify loss of DFT functionality when DFT straps are deasserted on the next POR cycle.
Note: these tests require the ROM init stage to complete. So a test ROM image is loaded,
but the software does not test anything. The CPU boots and runs to completion while the
host (SV testbench) performs these stimulus / checks.
'''
stage: V2
tests: ["chip_tap_straps_dev", "chip_tap_straps_prod", "chip_tap_straps_rma",
"chip_tap_straps_testunlock0"]
}
// PATTGEN (pre-verified IP) integration tests:
{
name: chip_sw_pattgen_ios
desc: '''Verify pattern generation to chip output pads.
- Program the pattgen to generate a known pattern in each lane.
- Program the pinmux to route the chosen output to the chip IOs.
- Verify that the correct pattern is seen on the IOs by hooking up the pattgen monitor.
- Validate the reception of the done interrupt.
- Verify both pattgen channels independently.
'''
stage: V2
tests: ["chip_sw_pattgen_ios"]
}
// PWM (pre-verified IP) integration tests:
{
name: chip_sw_sleep_pwm_pulses
desc: '''Verify PWM signaling to chip output pads during deep sleep.
- Program each PWM output to pulse in a known pattern.
- Program the pinmux to route the chosen PWM output to the chip IOs.
- Program the pwrmgr to go to deep sleep state, with AON timer wakeup.
- Initiate the sleep state by issuing a WFI.
- Verify that in the sleep state, the PWM signals are active and pulsing correctly, by
hooking up the PWM monitor.
- Repeat the steps for all 6 PWM signals.
'''
stage: V2
tests: ["chip_sw_sleep_pwm_pulses"]
}
//////////////////////////////////////////////////////////////////////////////////////
// System Peripherals //
// XBAR, RV_DM, RV_TIMER, AON_TIMER, PLIC, CLK/RST/PWR MGR, ALERT_HANDLER, LC_CTRL, //
// ADC_CTRL, SYSRST_CTRL //
//////////////////////////////////////////////////////////////////////////////////////
// XBAR (pre-verified IP) tests:
{
name: chip_sw_data_integrity
desc: '''
Verify the alert signaling mechanism due to integrity violations of load ops.
An SW test which performs the following on main and retention SRAMs to verify the memory
end-to-end integrity scheme:
- Corrupt a random data / integrity bit in the memory using SV force.
- SW reads that address and the corrupted data is sent to ibex.
- Verify that ibex detects the integrity violation and triggers an alert.
- Check the alert up to the NMI phase and make sure that the alert cause is from Ibex.
'''
stage: V2
tests: ["chip_sw_data_integrity_escalation"]
}
{
name: chip_sw_instruction_integrity
desc: '''
Verify the alert signaling mechanism due to integrity violations of instruction fetches.
An SW test which performs the following on main SRAM to verify the memory end-to-end
integrity scheme:
- Corrupt a data / integrity bit in a test function in the main SRAM using SV force.
- SW jumps to that test function in the main SRAM.
- Verify that ibex detects the integrity violation and triggers an alert.
- Check the alert up to the NMI phase and make sure that the alert cause is from Ibex.
'''
stage: V2
tests: ["chip_sw_data_integrity_escalation"]
}
// RV_DM (JTAG) tests:
{
name: chip_jtag_csr_rw
desc: '''
Verify accessibility of all the CSRs in the chip over JTAG.
- Shuffle the list of CSRs first to remove the effect of ordering.
- Write all CSRs via JTAG interface with a random value.
- Shuffle the list of CSRs yet again.
- Read all CSRs back and check their values for correctness while adhering to the CSR's
access policies.
- Accesses to CSRs external to `rv_dm` go through RV_DM SBA interface into the `xbar`.
'''
stage: V2
tests: ["chip_jtag_csr_rw"]
}
{
name: chip_jtag_mem_access
desc: '''
Verify accessibility of all the memories in the chip over JTAG.
This test will target the following memories in the chip:
sram_main, sram_ret, otbn i|dmem, ROM
- Shuffle the list of memories first to remove the effect of ordering.
- Write a location in a randomly chosen set of addresses within each memory via JTAG
interface with random values.
- For read-only memories, preload the memory with random data via backdoor.
- Shuffle the list of memories again.
- Read the previously written addresses in the memories back again and check the read
value for correctness. Pick some random addresses to verify in case of read-only
memories.
'''
stage: V2
tests: ["chip_jtag_mem_access"]
}
{
name: chip_rv_dm_perform_debug
desc: '''
- X-ref'ed with rom_e2e_jtag_inject from rom testplan.
- X-ref'ed with chip_sw_flash_lc_iso_part_sw_wr_en.
- X-ref'ed with manuf_cp_device_info_flash_wr from manufacturing testplan.
- Using the sram injection mechanism from rom_e2e_jtag_inject, load a SRAM program that
writes to isolated flash partition while the device is in TEST_UNLOCKED state.
- After writing, verify that the test program cannot read back the written value.
'''
stage: V3
tests: ["rom_e2e_jtag_debug_test_unlocked0", "rom_e2e_jtag_debug_dev",
"rom_e2e_jtag_debug_rma"]
}
{
name: chip_rv_dm_ndm_reset_req
desc: '''Verify non-debug reset request initiated from RV_DM when the chip is awake.
- Program some CSRs / mem that are under life cycle reset tree and system reset tree.
- Configure RV_DM to send NDM reset request to reset sytem reset tree.
- While NDM reset is ongoing, ensure the RV_DM debug module registers can still be
accessed.
- Read the programmed CSRs / mem to ensure that everything under system reset tree is
reset to the original values, while values under life cycle reset will be preserved.
- Read CSRs / mem in the debug domain to ensure that the values survive the reset.
'''
stage: V2
tests: ["chip_rv_dm_ndm_reset_req"]
}
{
name: chip_sw_rv_dm_ndm_reset_req_when_cpu_halted
desc: '''Verify non-debug reset request initiated from RV_DM when the CPU is in halted state.
- Initialize the DUT in a HW-debug enabled life cycle state.
- Activate the RISCV debug module.
- Run some SW test on the CPU.
- Initiate a CPU halt request via JTAG.
- Wait for the CPU to be in halted state via JTAG by polling dmstatus.anyhalted.
- Deassert the CPU haltreq and verify that we are still in halted state.
- (Optional) Using the abstract command, read the dcsr register to verify the cause
reflects the debug halt request.
- Issue an NDM reset request. All non-debug parts of the chip should reset. Read the
dmstatus.anyhalted / dvstatus.allhalted and verify that they are cleared.
- Verify that the debug logic is fully accessible during this time, while the NDM reset
is being processed and the chip is rebooted, by continuously accessing the DMI
register space in `rv_dm` over JTAG.
- De-assert the NDM reset request and wait for the CPU to reboot and finish the post-NDM
reset phase of the test.
'''
stage: V2
tests: ["chip_sw_rv_dm_ndm_reset_req_when_cpu_halted"]
}
{
name: chip_rv_dm_access_after_wakeup
desc: '''Verify RV_DM works after wakes up from sleep.
- Put the chip into sleep mode and then wake up (both deep sleep and normal sleep).
- If waking up from normal sleep, an activation should not be required for RV_DM CSR
accesses to work.
- If waking up from deep sleep, an activation is required for RV_DM CSR accesses to work.
'''
stage: V2
tests: ["chip_sw_rv_dm_access_after_wakeup"]
}
{
name: chip_sw_rv_dm_access_after_hw_reset
desc: '''Verify RV_DM works after a watchdog or escalated reset.
- Access some RV_DM CSRs both before and after resets.
- An activation would be required, and the tap strap would also be sampled again.
'''
stage: V3
tests: ["chip_sw_rv_dm_access_after_escalation_reset"]
}
{
name: chip_sw_rv_dm_jtag_tap_sel
desc: '''Verify ability to select all available TAPs.
- Put life cycle on Test or RMA state, so that TAPs can be selected between life cycle
RV_DM and DFT.
- Verify the TAP is selected correctly.
- X-ref'ed with chip_sw_tap_strap_sampling.
'''
stage: V2
tests: ["chip_tap_straps_rma"]
}
{
name: chip_rv_dm_lc_disabled
desc: '''Verify that the debug capabilities are disabled in certain life cycle stages.
- Put life cycle in a random life cycle state.
- Verify that the rv_dm bus device is inaccessible from the CPU as well as external
JTAG if the life cycle state is not in TEST_UNLOCKED*, DEV or RMA.
- The bus access check is performed by randomly reading or writing a CSR inside the
RV_DM and checking whether the TL-UL bus errors out.
- The JTAG access check is performed by writing and then reading a register that is
accessible via the TAP/DMI inside the RV_DM. If the JTAG wires are gated, it is
expected that the RV_DM returns all-zero instead of the written value.
- X-ref'ed with `chip_tap_strap_sampling`
'''
stage: V2
tests: ["chip_rv_dm_lc_disabled"]
}
// RV_TIMER (pre-verified IP) integration tests:
{
name: chip_sw_timer
desc: '''Verify the timeout interrupt assertion.
- Configure the RV_TIMER to generate interrupt after a set timeout.
- Issue a WFI to wait for the interrupt to trigger.
- Service the interrupt when it triggers; verify that it came from rv_timer.
- Verify that the interrupt triggered only after the timeout elapsed.
'''
stage: V2
tests: ["chip_sw_rv_timer_irq"]
}
// AON_TIMER (pre-verified IP) integration tests:
{
name: chip_sw_aon_timer_wakeup_irq
desc: '''Verify the AON timer wake up interrupt in normal operating state.
- Program the PLIC to let the AON timer wake up interrupt the CPU.
- Program the AON timer to generate the wake up timeout interrupt after some time.
- Issue a WFI to wait for the interrupt to trigger.
- Service the interrupt when it triggers; verify that it came from AON timer.
- Verify that the interrupt triggered only after the timeout elapsed.
'''
stage: V2
tests: ["chip_sw_aon_timer_irq"]
}
{
name: chip_sw_aon_timer_sleep_wakeup
desc: '''Verify that AON timer can wake up the chip from a deep sleep state.
- Read the reset cause register in rstmgr to confirm that the SW is in the POR reset
phase.
- Program the pwrmgr to go to deep sleep state (clocks off, power off).
- Program the AON timer to wake up the chip in a reasonable amount of time.
- Have the CPU issue WFI to signal the pwrmgr to go into sleep state.
- Verify via assertion checks, the wake up request occurs after the timeout has elapsed.
- After reset followed by AON timer wake up, read the reset cause register to confirm
the AON timer wake up phase.
- After the test sequence is complete, read the wake up threshold register - it should
not be reset.
'''
stage: V2
tests: ["chip_sw_pwrmgr_smoketest"]
}
{
name: chip_sw_aon_timer_wdog_bark_irq
desc: '''Verify the watchdog bark reception in normal state.
- Program the PLIC to let the wdog bark signal interrupt the CPU.
- Program the AON timer wdog to 'bark' after some time and enable the bark interrupt.
- Service the bark interrupt upon reception.
'''
stage: V2
tests: ["chip_sw_aon_timer_irq"]
}
{
name: chip_sw_aon_timer_wdog_lc_escalate
desc: '''Verify that the LC escalation signal disables the AON timer wdog.
- Program the AON timer wdog to 'bark' after some time and enable the bark interrupt.
- Start the escalation process and fail the test in the interrupt handler in case the
bark interrupt is fired.
- Program the alert handler to escalate on alerts upto phase 2 (i.e. reset) but the
phase 1 (i.e. wipe secrets) should occur and last during the time the wdog is
programed to bark and bite.
- Trigger an alert to cause an escalation condition before the bark signal asserts.
- After the reset ensure that the reset cause was due to the escalation to prove that
the wdog was disabled.
'''
stage: V2
tests: ["chip_sw_aon_timer_wdog_lc_escalate"]
}
{
name: chip_sw_aon_timer_wdog_bite_reset
desc: '''Verify the watchdog bite causing reset in the normal state.
- Read the reset cause register in rstmgr to confirm that the SW is in the POR reset
phase.
- Program the AON timer wdog to 'bark' after some time.
- Let the bark escalate to bite, which should result in a reset request.
- After reset, read the reset cause register in rstmgr to confirm that the SW is now in
the wdog reset phase.
'''
stage: V2
tests: ["chip_sw_aon_timer_wdog_bite_reset"]
}
{
name: chip_sw_aon_timer_sleep_wdog_bite_reset
desc: '''Verify the watchdog bite causing reset in sleep state.
- Repeat the steps in chip_aon_timer_wdog_bite_reset test, but with following changes:
- Program the pwrmgr to go to deep sleep state (clocks off, power off).
- Issue a WFI after programming the wdog, so that the reset request due to bite occurs
during deep sleep state.
- After reset, read the reset cause register in rstmgr to confirm that the SW is now in
the wdog reset phase.
'''
stage: V2
tests: ["chip_sw_aon_timer_wdog_bite_reset"]
}
{
name: chip_sw_aon_timer_sleep_wdog_sleep_pause
desc: '''Verify that the wdog can be paused in sleep state.
- Repeat the steps in chip_aon_timer_sleep_wakeup test, but with following changes:
- Program the wdog to 'bite' a little sooner than the AON timer wake up.
- Also, program the wdog to pause during sleep.
- Issue a WFI after programming the wdog, so that the reset request occurs during deep
sleep state.
- After reset followed by AON timer wake up, read the reset cause register to confirm
that the AON timer woke up the chip, not the wdog reset.
- Un-pause the wdog and service the bark interrupt.
'''
stage: V2
tests: ["chip_sw_aon_timer_sleep_wdog_sleep_pause"]
}
// PLIC integration tests:
{
name: chip_sw_plic_all_irqs
desc: '''Verify all interrupts from all peripherals aggregated at the PLIC.
The automated SW test enables all interrupts at the PLIC to interrupt the core. It uses
the `intr_test` CSR in each peripheral to mock assert an interrupt, looping through all
available interrupts in that peripheral. The ISR verifies that the right interrupt
occurred. This is used as a catch-all interrupt test for all peripheral integration
testing within which functionally asserting an interrupt is hard to achieve or not of
high value.
'''
stage: V2
tests: ["chip_plic_all_irqs"]
}
{
name: chip_sw_plic_sw_irq
desc: '''Verify the SW interrupt to the CPU.
Enable all peripheral interrupts at PLIC. Enable all types of interrupt at the CPU core.
Write to the MSIP CSR to generate a SW interrupt to the CPU. Verify that the only
interrupt that is seen is the SW interrupt.
'''
stage: V2
tests: ["chip_sw_plic_sw_irq"]
}
{
name: chip_sw_plic_alerts
desc: '''Verify alerts from PLIC due to both, TL intg and reg WE onehot check faults.
- Since PLIC is not pre-verified in a DV environment, we need to ensure these are tested
separately.
'''
stage: V3
tests: ["chip_sw_all_escalation_resets"]
}
// CLKMGR tests:
{
name: chip_sw_clkmgr_idle_trans
desc: '''Verify the ability to turn off the transactional clock via SW.
Ensure that the clock to transactional units will be turned off after any activity
completes in the transactional IP. Verify it is off via spinwait in hints_status CSR.
Verify that turning off this clock does not affect the other derived clocks.
'''
stage: V2
tests: ["chip_sw_aes_idle",
"chip_sw_hmac_enc_idle",
"chip_sw_kmac_idle",
"chip_sw_otbn_randomness"]
}
{
name: chip_sw_clkmgr_off_trans
desc: '''Verify the turned off transactional units.
Verify CSR accesses do not complete in units that are off. Using the watchdog timers,
turn off a transactional unit's clock, issue a CSR access to that unit, verify a
watchdog event results, and verify the rstmgr crash dump info records the CSR address.
A stretch goal is to check the PC corresponds to the code performing the CSR access
(stretch since it could be difficult to maintain this check).
'''
stage: V2
tests: ["chip_sw_clkmgr_off_aes_trans",
"chip_sw_clkmgr_off_hmac_trans",
"chip_sw_clkmgr_off_kmac_trans",
"chip_sw_clkmgr_off_otbn_trans"]
}
{
name: chip_sw_clkmgr_off_peri
desc: '''Verify the ability to turn off the peripheral clock via SW.
Verify CSR accesses do not complete in peripherals that are off. Using the watchdog
timers, turn off a peripheral's clock, issue a CSR access to that peripheral, verify a
watchdog event results, and verify the rstmgr crash dump info records the CSR address.
'''
stage: V2
tests: ["chip_sw_clkmgr_off_peri"]
}
{
name: chip_sw_clkmgr_div
desc: '''Verify clk division logic is working correctly.
The IP level checks the divided clocks via SVA, and these are also bound at chip level.
Connectivity tests check peripherals are connected to the clock they expect.
Use the clkmgr count measurement feature to verify clock division.
'''
stage: V2
tests: ["chip_sw_clkmgr_external_clk_src_for_sw_fast_test_unlocked0",
"chip_sw_clkmgr_external_clk_src_for_sw_slow_test_unlocked0",
"chip_sw_clkmgr_external_clk_src_for_sw_fast_dev",
"chip_sw_clkmgr_external_clk_src_for_sw_slow_dev",
"chip_sw_clkmgr_external_clk_src_for_sw_fast_rma",
"chip_sw_clkmgr_external_clk_src_for_sw_slow_rma",
"chip_sw_clkmgr_external_clk_src_for_lc"]
}
{
name: chip_sw_clkmgr_external_clk_src_for_lc
desc: '''Verify the clkmgr requests ext clk src during certain LC states.
On POR lc asserts lc_clk_byp_req on some LC states, and de-asserts
it when lc_program completes. This also triggers divided clocks to step down. It may be
best to verify this via SVA, unless we implement clock cycle counters.
'''
stage: V2
tests: ["chip_sw_clkmgr_external_clk_src_for_lc"]
}
{
name: chip_sw_clkmgr_external_clk_src_for_sw
desc: '''Verify SW causes the clkmgr requests ext clk src during certain LC states.
In RMA and TEST_UNLOCKED lc states the external clock is enabled in response to
`extclk_ctrl.sel` CSR writes. In addition `extclk_ctrl.hi_speed_sel` CSR causes the
divided clocks to step down. Verify this via SVA bound to clkmgr, and clock cycle
counters.
Disable external clock source and verify the AST reliably falls back to the internal
clock. Ensure the chip operates normally.
X-ref with chip_sw_uart_tx_rx_alt_clk_freq, which needs to deal with this as well.
'''
stage: V2
tests: ["chip_sw_clkmgr_external_clk_src_for_sw_fast_test_unlocked0",
"chip_sw_clkmgr_external_clk_src_for_sw_slow_test_unlocked0",
"chip_sw_clkmgr_external_clk_src_for_sw_fast_dev",
"chip_sw_clkmgr_external_clk_src_for_sw_slow_dev",
"chip_sw_clkmgr_external_clk_src_for_sw_fast_rma",
"chip_sw_clkmgr_external_clk_src_for_sw_slow_rma"]
}
{
name: chip_sw_clkmgr_jitter
desc: '''Verify the clock jitter functionality.
Enable clock jitter setting the clkmgr `jitter_enable` CSR high. This causes the
jitter_o clkmgr output to toggle. Verify this output is connected to AST's
clk_src_sys_jen_i input using formal.
X-ref with various specific jitter enable tests.
'''
stage: V2
tests: ["chip_sw_clkmgr_jitter",
"chip_sw_flash_ctrl_ops_jitter_en",
"chip_sw_flash_ctrl_access_jitter_en",
"chip_sw_otbn_ecdsa_op_irq_jitter_en",
"chip_sw_aes_enc_jitter_en",