-
Notifications
You must be signed in to change notification settings - Fork 893
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
New aiger backend #4593
New aiger backend #4593
Conversation
#define KNOWN_OPS BITWISE_OPS, REDUCE_OPS, LOGIC_OPS, GATE_OPS /*, ARITH_OPS*/ | ||
|
||
template<typename Writer, typename Lit> | ||
struct Index { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried for a separation of concerns between this Index
struct (dealing with the generic problem of generating an AIG from the design) and a derived AigerWriter
which holds the AIGER specifics.
This means the Index
(or whatever we rename it to) can be reused for other places we may need an AIG, e.g. hypothetical commands linking to ABC and filling its data structures directly, or toymap, or commands linking to imctk, etc.
How did you resolve #3967 (comment) ? I can't reproduce it, but I don't see anything related in d5aae80 |
I am not sure if I did anything which would address that specifically. |
Current help printout:
|
backends/aiger2/aiger.cc
Outdated
template<typename Writer, typename Lit> | ||
struct Index { | ||
static constexpr Lit CFALSE = Writer::CONST_FALSE; | ||
static constexpr Lit CTRUE = Writer::CONST_TRUE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the VS build:
"D:\a\yosys\yosys\yosys-win32-vcxsrc-latest\YosysVS.sln" (default target) (1) ->
"D:\a\yosys\yosys\yosys-win32-vcxsrc-latest\YosysVS\YosysVS.vcxproj" (default target) (2) ->
(ClCompile target) ->
D:\a\yosys\yosys\yosys-win32-vcxsrc-latest\yosys\backends\aiger2\aiger.cc(49,40): error C2039: 'CONST_FALSE': is not a member of '`anonymous-namespace'::AigerWriter' [D:\a\yosys\yosys\yosys-win32-vcxsrc-latest\YosysVS\YosysVS.vcxproj]
D:\a\yosys\yosys\yosys-win32-vcxsrc-latest\yosys\backends\aiger2\aiger.cc(49,1): error C2065: 'CONST_FALSE': undeclared identifier [D:\a\yosys\yosys\yosys-win32-vcxsrc-latest\YosysVS\YosysVS.vcxproj]
Not sure what to think of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't it boil down to this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks. It's not clear to me if it's valid C++, or how to change it to make the compiler happy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was told "default member initializers are complete-class context, so I think msvc is wrong to reject this" by a clang dev. Seems to suggest that initializers aren't declared until the class is complete, which it isn't because you have something like a type dependency loop. I guess you have to find a different class structure for the functionality you want. It's not too surprising to me that there would be problems related to struct A : B<A>
As expected, we still have that queue pointer problem, I just had to re-run the unreduced file and re-reduce it. on this
|
I discussed this with @povik and decided that it seems safe to remove the bufnorm command and go on using the buffer normalized mode as a one-shot index without staying in the mode subsequently, avoiding the dynamic addition of pointers into the bufnormqueue |
This discussion belongs to |
You have linked this PR from itself and the universe will now proceed to explode. Did you mean #3967 ? You want this PR to only be merged after the bufnorm PR and a rebase? |
Yes, thanks.
Pretty much |
Rebased after merge of #3967 |
Just a drive-by nitpick, but in the off chance aiger2 does exist as a standard version at somepoint/to avoid confusion that we aren't supporting an aiger version that doesn't exist, would it be better to call this pass something else? |
If we cannot outright replace the existing backends I'd prefer we fold in the new code as an option on the existing backend commands, e.g. |
Oh yeah that works too definitely |
Start a new AIGER2 backend which accepts designs in less expanded forms. This is staging ground for new features before they are integrated into the existing XAIGER/AIGER backends.
Also add a
read_xaiger2 -sc_mapping
command and anabc_new
command for round tripping through ABC and obtaining an SC mapping back.What are the reasons/motivation for this change?
Some of the scalability ills of Yosys synthesis on large designs may be alleviated if we move more of the flattening/mapping/bit-blasting steps into the backend which writes out the design for ABC processing. Also this has potential to simplify non-synthesis flows.
Compared to the existing AIGER/XAIGER backends, this new backend is able to ingest
The levels of hierarchy may be design hierarchy, or hierarchy introduced by
techmap -extern
. This mentioned command would be a way for users to override/supplement the hard-coded mapping rules of the backend.There's rudimentary constant folding (working across hierarchy levels).