Commit Graph

13 Commits

Author SHA1 Message Date
Georg Wiese
96893cc143 Add Write-once memory to STD (#1202)
Fixes #844

This PR adds a new machine to the STD: `WriteOnceMemory`. This can be
used in our RISC-V machine for bootloader inputs (#1203).

Most of the issues mentioned in the issue were fixed in the meantime or
had a simple workaround (like defining `let LATCH = 1`). The only
remaining issues were in the machine detection, which I fixed here.

I also re-factor two existing tests.
2024-03-26 18:50:30 +00:00
Georg Wiese
a18577fed2 Add read/write memory to standard library (#1129)
With the recent changes by @pacheco, we can extract our [memory
machine](https://github.com/powdr-labs/powdr/blob/main/riscv/src/compiler.rs#L687-L841)
as a separate machine and add it to the standard library.

The result should be the same as calling the function linked above with
`with_bootloader=false`, except that the memory alignment stuff is not
inlined. For this reason, the machine is not yet used by the RISC-V
machine, but it could be after #1077 is implemented.

[This](eb320dca0c) shows the diff from
what we have in `compiler.rs`.

<!--

Please follow this protocol when creating or reviewing PRs in this
repository:

- Leave the PR as draft until review is required.
- When reviewing a PR, every reviewer should assign themselves as soon
as they
start, so that other reviewers know the PR is covered. You should not be
discouraged from reviewing a PR with assignees, but you will know it is
not
  strictly needed.
- Unless the PR is very small, help the reviewers by not making forced
pushes, so
that GitHub properly tracks what has been changed since the last review;
use
  "merge" instead of "rebase". It can be squashed after approval.
- Once the comments have been addressed, explicitly let the reviewer
know the PR
  is ready again.

-->
2024-03-25 17:33:55 +00:00
Georg Wiese
10aeae6cb5 Allow and use permutation in all std machines 2024-03-21 17:20:18 +01:00
Georg Wiese
f87a760071 Hints for arithmetic machine 2024-03-18 11:57:40 +01:00
Georg Wiese
3ce5a9f98a Add tests for Shift and Binary machines 2024-02-26 11:24:03 +01:00
Georg Wiese
40fe394c19 Add equations 1-4 2024-02-08 11:41:53 +01:00
Georg Wiese
9ea67369ce Arithmetic machine: Add equation selectors 2024-02-06 16:55:20 +01:00
Leandro Pacheco
39c5c62028 AST parsing and impl Display fixes
- `instr x = y` statements must end with semicolon
- fixed Display implementation for AST objects such that
  source->AST->source->AST works properly
- tests for the above
2024-02-05 18:40:00 -03:00
Georg Wiese
f91823e0ef Arith machine, Equation 0 2024-01-31 19:05:53 +01:00
chriseth
a1ba5707a9 Fix poseidon parsing on goldilocks. 2024-01-25 16:12:55 +01:00
Georg Wiese
f26a161ae3 Add SplitBN254 machine, use queries in SplitGL machine 2023-10-31 18:27:19 +00:00
Georg Wiese
263c03d77d WrapGL machine: return both high and low values 2023-10-05 16:18:28 +00:00
Georg Wiese
5268e6fc24 Add more machines to Powdr STD 2023-10-03 18:02:01 +00:00