Skip to content
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

zilsd/zcmlsd Support #490

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft

zilsd/zcmlsd Support #490

wants to merge 15 commits into from

Conversation

simonacostinescu
Copy link

Add support for not yet ratified zilsd/zcmlsd extension
In c_emulator, the following options are added:
-y to enable zilsd extension
-Z to enable zcmlsd extension

In ocaml emulator the following options are added:
-enable-zilsd to enable zilsd extension
-enable-zcmlsd to enable zcmlsd extension

All options are false by default.
The tests were split in Zilsd and Zcmlsd folders because different simulation options are required to run the tests.

@@ -141,6 +141,8 @@ static struct option options[] = {
{"trace-output", required_argument, 0, OPT_TRACE_OUTPUT },
{"inst-limit", required_argument, 0, 'l' },
{"enable-zfinx", no_argument, 0, 'x' },
{"enable-zilsd", no_argument, 0, 'y' },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use long options like OPT_ENABLE_WRITABLE_FIOM?

@@ -43,6 +43,7 @@
/* (ERC) under the European Union’s Horizon 2020 research and innovation */
/* programme (grant agreement 789108, ELVER). */
/* */
/* Modified by NXP on 02/02/2024 */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be based on an older commit - can you rebase on master?

signed loads also present for widths equal to xlen_bytes */
/* for Zilsd unsigned loads are only present for widths strictly less than xlen_bytes*2,
signed loads also present for widths equal to xlen_bytes*2 */
mapping clause encdec = LOAD(imm, rs1, rd, is_unsigned, size, false, false) if (word_width_bytes(size) < sizeof(xlen_bytes)) | (not(is_unsigned) & word_width_bytes(size) <= sizeof(xlen_bytes)) | (haveZilsd() & (word_width_bytes(size) < sizeof(xlen_bytes)*2) | (not_bool(is_unsigned) & word_width_bytes(size) <= sizeof(xlen_bytes)*2))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guard clause is crazy long now. Probably worth moving to a function?


val extend_value : forall 'n, 0 < 'n <= xlen_bytes. (bool, MemoryOpResult(bits(8 * 'n))) -> MemoryOpResult(xlenbits)
function extend_value(is_unsigned, value) = match (value) {
MemValue(v) => MemValue(if is_unsigned then zero_extend(v) else sign_extend(v) : xlenbits),
MemException(e) => MemException(e)
}

val extend_value_pair : forall 'n, 0 < 'n <= xlen_bytes*2. (bool, MemoryOpResult(bits(8 * 'n))) -> MemoryOpResult(xlenbits_double)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is all going to conflict fairly heavily with #477 unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants