-
Notifications
You must be signed in to change notification settings - Fork 18
[hw,dv,sw] Add support for HW_ID for SW #584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,6 +103,20 @@ | |
| run_opts: ["+ChipMemSRAM_image_file={run_dir}/timer_interrupt_test_cheri_sram.vmem", | ||
| "+ChipMemROM_image_file={run_dir}/bootrom.vmem"] | ||
| } | ||
| { | ||
| name: test_framework_test | ||
| uvm_test_seq: top_chip_dv_base_vseq | ||
| sw_images: ["test_framework_test_vanilla_sram:5" "bootrom:5"] | ||
| run_opts: ["+ChipMemSRAM_image_file={run_dir}/test_framework_test_vanilla_sram.vmem", | ||
| "+ChipMemROM_image_file={run_dir}/bootrom.vmem"] | ||
| } | ||
| { | ||
| name: test_framework_test_cheri | ||
| uvm_test_seq: top_chip_dv_base_vseq | ||
| sw_images: ["test_framework_test_cheri_sram:5" "bootrom:5"] | ||
| run_opts: ["+ChipMemSRAM_image_file={run_dir}/test_framework_test_cheri_sram.vmem", | ||
| "+ChipMemROM_image_file={run_dir}/bootrom.vmem"] | ||
| } | ||
| { | ||
| name: test_framework_exception_test | ||
| uvm_test_seq: top_chip_dv_base_vseq | ||
|
|
@@ -339,6 +353,8 @@ | |
| "rv_timer_smoke_cheri", | ||
| "rv_timer_irq", | ||
| "rv_timer_irq_cheri", | ||
| "test_framework_test", | ||
| "test_framework_test_cheri", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're adding these before the tests are added.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the C test were already existing before this PR. Is that what you meant? |
||
| "test_framework_exception_test", | ||
| "test_framework_exception_test_cheri", | ||
| "spi_device_smoke", | ||
|
|
@@ -389,6 +405,8 @@ | |
| { | ||
| name: test_framework | ||
| tests: [ | ||
| "test_framework_test", | ||
| "test_framework_test_cheri", | ||
| "test_framework_exception_test", | ||
| "test_framework_exception_test_cheri" | ||
| ] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ package top_pkg; | |
| SRAMBase = 64'h1000_0000, | ||
| DebugMemBase = 64'h2000_0000, | ||
| MailboxBase = 64'h2001_0000, | ||
| RestOfChipBase = 64'h3000_0000, | ||
| RestOfChipBase = 64'h2002_0000, | ||
| TlCrossbarBase = 64'h4000_0000, | ||
| DRAMBase = 64'h8000_0000 | ||
| } axi_addr_start_t; | ||
|
|
@@ -50,7 +50,7 @@ package top_pkg; | |
| localparam longint unsigned SRAMLength = 64'h0002_0000; | ||
| localparam longint unsigned DebugMemLength = 64'h0000_1000; | ||
| localparam longint unsigned MailboxLength = 64'h0001_0000; | ||
| localparam longint unsigned RestOfChipLength = 64'h0000_8000; | ||
| localparam longint unsigned RestOfChipLength = 64'h0FFE_8000; // 0x2002_0000 to 0x3000_7FFF | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You shouldn't add the DV window to the rest of chip bus. It should be a separate AXI port.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure I understand, do you want a new dedicated AXI port on
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I think that's what Marno meant. |
||
| localparam longint unsigned TlCrossbarLength = 64'h1000_0000; | ||
| localparam longint unsigned DRAMPhysicalLength = 64'h4000_0000; | ||
|
|
||
|
|
@@ -64,23 +64,26 @@ package top_pkg; | |
|
|
||
| // Rest of chip AXI crossbar parameters | ||
| localparam int RestOfChipAxiXbarHosts = 1; | ||
| localparam int RestOfChipAxiXbarDevices = 1; | ||
| localparam int RestOfChipAxiXbarDevices = 2; | ||
|
|
||
| // Rest of chip AXI crossbar hosts and devices | ||
| typedef enum int unsigned { | ||
| MochaAXICrossbar = 0 | ||
| } rest_of_chip_axi_hosts_t; | ||
|
|
||
| typedef enum int unsigned { | ||
| Ethernet = 0 | ||
| Ethernet = 0, | ||
| SwDvWindowDevIdx = 1 | ||
| } rest_of_chip_axi_devices_t; | ||
|
|
||
| typedef enum longint unsigned { | ||
| EthernetBase = 64'h3000_0000 | ||
| EthernetBase = 64'h3000_0000, | ||
| SwDvWindowBase = 64'h2002_0000 | ||
| } rest_of_chip_axi_addr_start_t; | ||
|
|
||
| // Memory lengths | ||
| localparam longint unsigned EthernetLength = 64'h0000_8000; | ||
| localparam longint unsigned EthernetLength = 64'h0000_8000; | ||
| localparam longint unsigned SwDvWindowLength = 64'h0000_0100; | ||
|
|
||
| // Memory address masks | ||
| localparam longint unsigned EthernetMask = EthernetLength - 1; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // Copyright lowRISC contributors (COSMIC project). | ||
| // Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| // Design Verification (DV) register window. | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <stdint.h> | ||
|
|
||
| /* These values are written to the test_status register of the DV window | ||
| * throughout a test to indicate test progression and outcome. */ | ||
| enum dv_test_status : uint32_t { | ||
| /* Test code has begun. */ | ||
| dv_test_status_in_test = 0x4354u, | ||
| /* The test has passed. */ | ||
| dv_test_status_passed = 0x900du, | ||
| /* The test has failed. */ | ||
| dv_test_status_failed = 0xbaadu, | ||
| }; | ||
|
|
||
| /* These values are provided by the DV window from the hw_id register to | ||
| * indicate the current test platform. */ | ||
| enum dv_hwid : uint32_t { | ||
| /* Running on the Genesys2 FPGA. */ | ||
| dv_hwid_fpga_genesys2 = 0xau, | ||
| /* Running in a Verilator simulation. */ | ||
| dv_hwid_sim_verilator = 0x1au, | ||
| /* Running in a UVM simulation. */ | ||
| dv_hwid_sim_uvm = 0x2au, | ||
| }; | ||
|
|
||
| typedef volatile struct [[gnu::aligned(4)]] dv_window_memory_layout { | ||
| /* test_status (0x0) */ | ||
| uint32_t test_status; | ||
|
|
||
| /* hw_id (0x4) */ | ||
| const uint32_t hw_id; | ||
|
|
||
| const uint8_t __reserved0[0x100 - 0x08]; | ||
| } *dv_window_t; | ||
|
|
||
|
|
||
| _Static_assert(__builtin_offsetof(struct dv_window_memory_layout, test_status) == 0x0ul, | ||
| "incorrect register test_status offset"); | ||
| _Static_assert(__builtin_offsetof(struct dv_window_memory_layout, hw_id) == 0x4ul, | ||
| "incorrect register hw_id offset"); |
Uh oh!
There was an error while loading. Please reload this page.