Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Wren6991/Hazard3
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1-rc1
Choose a base ref
...
head repository: Wren6991/Hazard3
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: develop
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Jun 8, 2025

  1. Copy the full SHA
    aba9b04 View commit details

Commits on Jun 20, 2025

  1. Copy the full SHA
    3527bd6 View commit details
Showing with 31 additions and 2 deletions.
  1. +1 −1 doc/sections/configuration_and_integration.adoc
  2. +16 −1 doc/sections/csr.adoc
  3. +14 −0 hdl/hazard3_csr.v
2 changes: 1 addition & 1 deletion doc/sections/configuration_and_integration.adoc
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ If Xh3irq is configured, this is a vector of level-sensitive active-high system
| 32 | In | `mhartid_val` | Set the value of the <<reg-mhartid>> CSR, which software uses to determine on which hart it is running. Hazard3 implements one hart per core, so this is effectively a per-core identification value.

At least one hart must have the value of all-zeroes.
| 4 | In | `eco_version` | Set the value of the `eco` version number in <<reg-h3.misa>>.
| 4 | In | `eco_version` | Set the value of the `eco` version number in <<reg-mimpid>>.

On ASIC this should be connected to metal-programmable tie cells so that it can be incremented with metal changes. The initial value should be all-zeroes. On FPGA this should be tied to all-zeroes.

17 changes: 16 additions & 1 deletion doc/sections/csr.adoc
Original file line number Diff line number Diff line change
@@ -974,7 +974,7 @@ bool h3_misa_extension_supported(unsigned int groupid, unsigned int bit_position

Index `0x401` contains the length in _words_ of the custom extension listing, which starts from index `0x500`.

Indices `0x500` onward contain versions of custom Hazard3 extensions, with the same `major.minor.patch` format. A value of all-zeroes indicates the extension is not implemented.
Indices `0x500` onward contain versions of custom Hazard3 extensions:

[options="header"]
|===
@@ -986,5 +986,20 @@ Indices `0x500` onward contain versions of custom Hazard3 extensions, with the s
| `0x504` | Xh3bextm
|===

The custom extension entries have the same `major.minor.patch` format as <<reg-mimpid>>:

[cols="10h,20h,~", options="header"]
|===
| Bits | Name | Description
| 31:28 | - | RES0
| 27:24 | `major` | Major release version, i.e. the `1` in `v1.2.3`
| 23:16 | `minor` | Minor release version, i.e. the `2` in `v1.2.3`
| 15:8 | `patch` | Patch version, i.e. the `3` in `v1.2.3`
| 7:0 | - | RES0
|===


A value of all-zeroes indicates the custom extension is not implemented.



14 changes: 14 additions & 0 deletions hdl/hazard3_csr.v
Original file line number Diff line number Diff line change
@@ -240,6 +240,20 @@ always @ (posedge clk or negedge rst_n) begin
// is halted for debug.)
m_mode <= wdata_update[1];
end
if (!U_MODE) begin
// Explicitly tie-off to constant; some synthesis tools don't like
// it when variables are only sensitive to the reset.
m_mode <= 1'b1;
mstatus_mpp <= 1'b1;
end
end else begin
// Explicitly tie-off to constant when !CSR_M_TRAP
m_mode <= 1'b1;
mstatus_mpie <= 1'b0;
mstatus_mie <= 1'b0;
mstatus_mpp <= 1'b1;
mstatus_mprv <= 1'b0;
mstatus_tw <= 1'b0;
end
end