File tree Expand file tree Collapse file tree 4 files changed +47
-1
lines changed Expand file tree Collapse file tree 4 files changed +47
-1
lines changed Original file line number Diff line number Diff line change @@ -1246,6 +1246,7 @@ struct LakeroadWorker {
1246
1246
}
1247
1247
1248
1248
// The let-bound ID string of the expression to extract from.
1249
+ // FIXME: On certain inputs - this never terminates. Not sure if this is a problem
1249
1250
auto extract_from_expr = get_expression_for_signal (sigmap (sig.chunks ()[0 ].wire ), -1 );
1250
1251
auto new_id = get_new_id_str ();
1251
1252
auto extract_expr = stringf (" (Op1 (Extract %d %d) %s)" , (chunk.offset + chunk.width - 1 ) + chunk.wire ->start_offset ,
@@ -1291,7 +1292,7 @@ struct LakeroadWorker {
1291
1292
f << " \n ; cells\n " ;
1292
1293
for (auto cell : module ->cells ()) {
1293
1294
1294
- if (cell->type .in (ID ($logic_not))) {
1295
+ if (cell->type .in (ID ($logic_not), ID ($ not ) )) {
1295
1296
// Unary ops.
1296
1297
assert (cell->connections ().size () == 2 );
1297
1298
auto y = sigmap (cell->getPort (ID::Y));
@@ -1301,6 +1302,8 @@ struct LakeroadWorker {
1301
1302
std::string op_str;
1302
1303
if (cell->type == ID ($logic_not))
1303
1304
op_str = " (LogicNot)" ;
1305
+ else if (cell->type == ID ($not ))
1306
+ op_str = " (Not)" ;
1304
1307
else
1305
1308
log_error (" This should be unreachable. You are missing an else if branch.\n " );
1306
1309
Original file line number Diff line number Diff line change
1
+ read_verilog -sv <<EOF
2
+ module test(input [2:0] a, output [2:0] out);
3
+ // assign out = ~ a;
4
+ always_comb begin
5
+ case (a)
6
+ 2'b01: out = 2'b10;
7
+ 2'b00: out = 2'b10;
8
+ 2'b10: out = 2'b00;
9
+ 2'b11: out = 2'b01;
10
+ default: out = 2'b01;
11
+ endcase
12
+ end
13
+ endmodule
14
+ EOF
15
+ # Optimize out the mux to simple gates.
16
+ prep -top test; pmuxtree;
17
+ proc; opt; memory; opt;
18
+ techmap; opt;
19
+ abc; opt;
20
+ write_lakeroad
21
+ # Writing the verilog first with "-noattr" doesn't cause infinite loop
22
+ # write_verilog -noattr simple-mux.v
Original file line number Diff line number Diff line change
1
+ read_verilog -sv <<EOF
2
+ /* This module is generated by using "simple-mux.ys" + "write_verilog -noattr simple-mux.v". Delete this once you find the problem(most likely due to attributes). */
3
+ module test(a, out);
4
+ wire _0_;
5
+ input [2:0] a;
6
+ wire [2:0] a;
7
+ output [2:0] out;
8
+ wire [2:0] out;
9
+ assign _0_ = a[0] & a[1];
10
+ assign out[1] = ~(a[1] | a[2]);
11
+ assign out[0] = a[2] | _0_;
12
+ assign out[2] = 1'h0;
13
+ endmodule
14
+ EOF
15
+ write_lakeroad
Original file line number Diff line number Diff line change
1
+ read_verilog -sv <<EOF
2
+ module test(input a, output out);
3
+ assign out = ~ a;
4
+ endmodule
5
+ EOF
6
+ write_lakeroad
You can’t perform that action at this time.
0 commit comments