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

[tracking] Synthesize Ibex with Yosys #60

Open
imphil opened this issue Jun 5, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@imphil
Copy link
Collaborator

commented Jun 5, 2019

This is a tracking bug. This description will be updated to reflect the current state of affairs. Comment if you have suggestions or updates.

Yosys currently supports only a limited subset of SystemVerilog, which isn't sufficient to parse Ibex. This issue tracks the outstanding issues. We are generally open to find a common ground between tools, but only as long as it doesn't affect code quality and correctness. This means some issues will be resolved upstream in Yosys, while others might be worked around in Ibex.

Packed multidimensional arrays not supported

Example

logic [7:0][31:0] a;

Code workaround

Single-dimensional arrays

logic [8*32-1:0] a;

Possibly memories?

logic [31:0] a [8];

Yosys bugs

Enum / Typedef not supported

Example

typedef enum logic[1:0] { D = 2'b11, C = 2'b10, B = 2'b01, A = 2'b00 } ALP;

Code workaround

params; defines

Yosys bugs

Assert property sensitivity list not supported

Example

assert property ( @(posedge clk) ...)

Workaround

  • Do not use assert (for formal verification) (We disable asserts already for Verilator, we can just make the define a bit more generic for all tools which don't understand these assertions.)
  • (not tested) use immediate assertions

Int types not supported

Example

int unsigned i;

Code workaround

integer i;

Loop variable definition not at statement allowed

Example

for (integer i=0; i<5; i++) ...

Code workaround

integer i; ... for (i=0;...

Break keyword not supported

for (...) if (a==b) break; ... 

Code workaround

use variable which if set to not enter loop part again

Package parameter keyword not allowed

package p; parameter A = 2'b00;  endpackage 

Code workaround

Use local param

Thanks @towoe for compiling this list!

@imphil

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 5, 2019

Looking at this list, we can most likely work around all Yosys problems except for the package parameters and the enum/typedefs. These need to be fixed upstream.

The package parameter problem doesn't seem to have an upstream bug report yet. @towoe since you've worked on this, would you mind filing one upstream?

@towoe

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2019

@imphil regarding the package parameter I just did a very simple addition in towoe/yosys-sv@88b1e84
I am however not sure if this is correct or breaks anything else, but it seemed to work at my end.
As this is so small, maybe a PR to yosys can quickly answer that?

@imphil

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 5, 2019

Let's give it a try!

@towoe

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2019

As I wanted to split out the commit I just realized that this has dependencies to the other commits, I have to check what effects this has.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.