-
Notifications
You must be signed in to change notification settings - Fork 894
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
Add Optimization Barriers #4763
base: main
Are you sure you want to change the base?
Changes from all commits
bdc9783
70646da
88816cc
6b3901e
ab293d6
cbe86af
73ba5da
c352f71
c6e8fb2
33d5138
f372def
6532cf6
3ed98d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -677,7 +677,7 @@ struct Smt2Worker | |
if (cell->type == ID($eqx)) return export_bvop(cell, "(= A B)", 'b'); | ||
|
||
if (cell->type == ID($not)) return export_bvop(cell, "(bvnot A)"); | ||
if (cell->type == ID($pos)) return export_bvop(cell, "A"); | ||
if (cell->type.in(ID($pos), ID($buf), ID($barrier))) return export_bvop(cell, "A"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this will crash when given a |
||
if (cell->type == ID($neg)) return export_bvop(cell, "(bvneg A)"); | ||
|
||
if (cell->type == ID($add)) return export_bvop(cell, "(bvadd A B)"); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1071,7 +1071,7 @@ bool dump_cell_expr(std::ostream &f, std::string indent, RTLIL::Cell *cell) | |
return true; | ||
} | ||
|
||
if (cell->type == ID($_BUF_)) { | ||
if (cell->type.in(ID($buf), ID($_BUF_), ID($barrier))) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We met here :) (see #4803) |
||
f << stringf("%s" "assign ", indent.c_str()); | ||
dump_sigspec(f, cell->getPort(ID::Y)); | ||
f << stringf(" = "); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -430,15 +430,15 @@ bool SatGen::importCell(RTLIL::Cell *cell, int timestep) | |
return true; | ||
} | ||
|
||
if (cell->type.in(ID($pos), ID($buf), ID($neg))) | ||
if (cell->type.in(ID($pos), ID($buf), ID($barrier), ID($neg))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think by supplying a SAT model for |
||
{ | ||
std::vector<int> a = importDefSigSpec(cell->getPort(ID::A), timestep); | ||
std::vector<int> y = importDefSigSpec(cell->getPort(ID::Y), timestep); | ||
extendSignalWidthUnary(a, y, cell); | ||
|
||
std::vector<int> yy = model_undef ? ez->vec_var(y.size()) : y; | ||
|
||
if (cell->type.in(ID($pos), ID($buf))) { | ||
if (cell->type.in(ID($pos), ID($buf), ID($barrier))) { | ||
ez->assume(ez->vec_eq(a, yy)); | ||
} else { | ||
std::vector<int> zero(a.size(), ez->CONST_FALSE); | ||
|
@@ -451,7 +451,7 @@ bool SatGen::importCell(RTLIL::Cell *cell, int timestep) | |
std::vector<int> undef_y = importUndefSigSpec(cell->getPort(ID::Y), timestep); | ||
extendSignalWidthUnary(undef_a, undef_y, cell); | ||
|
||
if (cell->type.in(ID($pos), ID($buf))) { | ||
if (cell->type.in(ID($pos), ID($buf), ID($barrier))) { | ||
ez->assume(ez->vec_eq(undef_a, undef_y)); | ||
} else { | ||
int undef_any_a = ez->expression(ezSAT::OpOr, undef_a); | ||
|
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.
It's strange this interprets
$pos
without looking at theA_SIGNED
parameter, but if there's a bug it's pre-existing