sifive / prockami Goto Github PK
View Code? Open in Web Editor NEWKami based processor implementations and specifications
License: Apache License 2.0
Kami based processor implementations and specifications
License: Apache License 2.0
The mem_region_read, mem_region_write, and mem_region_fetch actions must be preceded by appropriate PMP checks. Add the necessary calls to pmp_check_read, pmp_check_write, and pmp_check_execute where appropriate.
Revise the checkForAccessFault (rename to checkForFault) so that it returns a 2 bit vector that specifies which, if any, of the following errors occured:
Returns 2 Bools: access fault or misaligned error.
the trapAction action is not updating the mcause register correctly. It contains a register write statement that contains a Kami Kind error - i.e. the write statement's Kind signature does not match the Kind of the register. As a result, Kami is silently ignoring this write statement.
These files use gallina let instead of Kami Let.
CompressedInsts.v
FU.v
ProcessorCore.v
Alu.v
Jump.v
Fpu.v
The rv64ud-p-structural and rv64ui-p-simple tests are timing out. Both end in an ecall that results in an infinite loop. When the processor model encounters an ecall, it loops back to address 0 which then leads it to repeat these tests.
This field will specify whether or not the current instruction is compressed.
(decoderWithException (func_units _) (CompInstDb _) ($$ supportedExts) (mode _)
Currently different views have different types for registers, and nobody is checking if the reads are correct. Here's the proposed solution:
The RISC-V spec requires us to designate certain register fields as WARL (write any - read legal) fields. When an invalid value is written to these fields, the processor does not throw an exception. However, the value returned on subsequent writes must be a legal value. Unfortunately, the spec allows implementations to chose any legal value to return. Extend the CSR interface so that every CSR entry has an associated valid predicate and an input transform function.
The valid predicate function's type is as follows:
Definition WarlStateField k := STRUCT {
"csrValueToWrite" :: k;
"pc" :: VAddr;
"compressed?" :: Bool }
Definition FieldUpd k := STRUCT {
"warlStateField" :: WarlStateField k;
"config" :: ConfigCtxtPkt
}
k ## ty
-> FieldUpd k ## ty
-> Bool ## ty
The function that computes the new value to be written is as follows:
k ## ty
-> FieldUpd k ## ty
-> k ## ty
Initially, we will use a last "legal value" policy. Modify the CSR interface to use these functions when writing CSR values.
The current version of the ZiCSR functional unit applies the masks to CSR values in its input transform functions and passes the resulting CSR value to the Register Writer. Murali asked me to change the CSR interface so that the RegMapper.locationReadWrite function accepts a mask value and applies the mask value to write values. This will move the mask application to StdLibKami.RegMapper. Revise ZiCSR so that it passes two values to its context update packet - the register value to store in the CSR and the mask value to apply, rather than just the masked result.
The rv64mi-p-access test issues an invalid jump instruction (at address 10c) that appears to be intended to raise a PMP access exception. Currently, the fetch unit does not raise exceptions. Revise the Fetch unit so that it raises access exceptions and add the PMP registers. Comply with the following:
"Attempting to fetch an instruction from a PMP region that does not have execute permissions raises a fetch access exception..." and latter "If no PMP entry mathces an M-mode access, the access succeed. If no PMP entry matches an S-mode or U-mode access, but at least one PMP entry is implemented, the access fails." (edited)
Finally "Failed accesses generate a load, store, or instruction access exception."
The C extension field CSR register's isvalid predicate should reject write requests when the current PC is not aligned to a 32 bit boundary.
Xlen and Flen sized registers must be sign extended to Rlen
"instMisalignedException?" :: Bool ;
"memMisalignedException?" :: Bool ;
"accessException?" :: Bool
The transformation should filter the xlens fields so that they only contain those values less than or equal to max xlen.
DecoderPkt
ExecContextPkt
ContextCfgPkt
should contain "xlen", "mode" and "extensions"ContextCfgPkt
, by reading appropriate CSR registers (directly, not through the CSR-read interface). "xlen" should be filled by using either mxl, hxl, sxl, uxl depending on the mode CSRContextCfgPkt
should be an input to createInputXform
The page table walker currently returns a Maybe PAddr type. Change the type signature so that the pt_walker returns a PktWithException PAddr type and modify pt_walker so that it throws the correct access and page fault exceptions when errors occur.
The trapAction function contains a write to the "mpp" and "spp" registers. These registers have different Kami kinds, but both are written to by the same Kami statement. The kind signature associated with this statement matches the Kind of the "mpp" register. Consequently, this statement has a kind error when writing to the "spp" register. Modify the trapAction function so that it writes the kind signature is correct by adding a width parameter to the trapAction function and setting it correctly in the calling function (commit).
filter xlens in decode_match_xlen so that the list is only those values less than Xlen.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.