Line 153... |
Line 153... |
default: assert (0);
|
default: assert (0);
|
}
|
}
|
}
|
}
|
} else if (ii->index == II_LRBB) {
|
} else if (ii->index == II_LRBB) {
|
GEN (" if (rst) t%x_%x <= #Tp 1'b0;\n", b, i);
|
GEN (" if (rst) t%x_%x <= #Tp 1'b0;\n", b, i);
|
assert (f->bb[b].prev[0] >= 0);
|
assert (f->bb[b].prev[0] >= 0 && f->bb[b].prev[0] != BBID_END);
|
GEN (" else if (bb_start[%i]) t%x_%x <= #Tp bb_stb[%i];\n", b, b, i, f->bb[b].prev[0]);
|
GEN (" else if (bb_start[%i]) t%x_%x <= #Tp bb_stb[%i];\n", b, b, i, f->bb[b].prev[0]);
|
} else if (ii->index == II_REG) {
|
} else if (ii->index == II_REG) {
|
GEN (" if (rst) t%x_%x <= #Tp 32'h0;\n", b, i);
|
GEN (" if (rst) t%x_%x <= #Tp 32'h0;\n", b, i);
|
assert (ii->opt[1] == OPT_REF);
|
assert (ii->opt[1] == OPT_REF);
|
GEN (" else if (");
|
GEN (" else if (");
|
Line 456... |
Line 456... |
if (end_bb->mdep) {
|
if (end_bb->mdep) {
|
GEN (" && ");
|
GEN (" && ");
|
print_deps (fo, f, end_bb_no, end_bb->mdep, 0);
|
print_deps (fo, f, end_bb_no, end_bb->mdep, 0);
|
}
|
}
|
|
|
/* Is there a loop right at end? */
|
/* Is there a loop right at the end? */
|
if (end_bb->next[0] >= 0) {
|
if (end_bb->next[0] != BBID_END || end_bb->next[1] != BBID_END && end_bb->next[1] >= 0) {
|
int bidx = branch_index (end_bb);
|
int bidx = branch_index (end_bb);
|
char t[30];
|
char t[30];
|
print_op_v (f, t, REF (end_bb_no, bidx), 1);
|
print_op_v (f, t, REF (end_bb_no, bidx), 1);
|
GEN (" && !%s", t);
|
GEN (" && !%s", t);
|
}
|
}
|
Line 471... |
Line 471... |
|
|
GEN ("\n/* Basic block triggers */\n");
|
GEN ("\n/* Basic block triggers */\n");
|
GEN ("wire [%2i:0] bb_start = {\n", f->num_bb - 1);
|
GEN ("wire [%2i:0] bb_start = {\n", f->num_bb - 1);
|
for (b = f->num_bb - 1; b >= 0; b--) {
|
for (b = f->num_bb - 1; b >= 0; b--) {
|
GEN (" /* bb_start[%2i] */ ", b);
|
GEN (" /* bb_start[%2i] */ ", b);
|
if (f->bb[b].prev[0] < 0) GEN ("start_i");
|
for (i = 0; i < 2; i++) if (f->bb[b].prev[i] >= 0) {
|
else {
|
cuc_bb *prev = &f->bb[f->bb[b].prev[i]];
|
cuc_bb *prev = &f->bb[f->bb[b].prev[0]];
|
|
int t;
|
int t;
|
|
if (i) GEN ("\n || ");
|
if (prev->mdep) {
|
if (prev->mdep) {
|
print_deps (fo, f, f->bb[b].prev[0], prev->mdep, 0);
|
print_deps (fo, f, f->bb[b].prev[i], prev->mdep, 0);
|
GEN (" && ");
|
GEN (" && ");
|
}
|
}
|
GEN ("bb_stb[%i]", f->bb[b].prev[0]);
|
GEN ("bb_stb[%i]", f->bb[b].prev[i]);
|
if (prev->next[0] >= 0 && prev->next[1] >= 0) {
|
if (prev->next[0] >= 0 && prev->next[0] != BBID_END
|
int bi = REF (f->bb[b].prev[0], branch_index (&f->bb[f->bb[b].prev[0]]));
|
&& prev->next[1] >= 0 && prev->next[1] != BBID_END) {
|
|
int bi = REF (f->bb[b].prev[i], branch_index (&f->bb[f->bb[b].prev[i]]));
|
int ci;
|
int ci;
|
assert (bi >= 0);
|
assert (bi >= 0);
|
ci = f->INSN(bi).op[1];
|
ci = f->INSN(bi).op[1];
|
t = prev->next[0] == b;
|
t = prev->next[0] == b;
|
GEN (" && ");
|
GEN (" && ");
|
Line 495... |
Line 496... |
fprintf (stderr, "%x!%x!%x\n", bi, ci, f->INSN(bi).opt[1]);
|
fprintf (stderr, "%x!%x!%x\n", bi, ci, f->INSN(bi).opt[1]);
|
assert (f->INSN(bi).opt[1] & OPT_CONST);
|
assert (f->INSN(bi).opt[1] & OPT_CONST);
|
GEN ("%s%i", t ? "" : "!", ci);
|
GEN ("%s%i", t ? "" : "!", ci);
|
}
|
}
|
}
|
}
|
if (f->bb[b].prev[1] >= 0) {
|
} else break;
|
prev = &f->bb[f->bb[b].prev[1]];
|
if (!i) GEN ("start_i");
|
GEN ("\n || ");
|
|
if (prev->mdep) {
|
|
print_deps (fo, f, f->bb[b].prev[1], prev->mdep, 0);
|
|
GEN (" && ");
|
|
}
|
|
GEN ("bb_stb[%i]", f->bb[b].prev[1]);
|
|
if (prev->next[0] >= 0 && prev->next[1] >= 0) {
|
|
int bidx = branch_index (&f->bb[f->bb[b].prev[1]]);
|
|
assert (bidx >= 0);
|
|
GEN (" && ");
|
|
t = prev->next[0] == b;
|
|
GEN ("%st%x_%x", t ? "" : "!", f->bb[b].prev[1], bidx);
|
|
}
|
|
}
|
|
}
|
|
if (b == 0) GEN ("};\n");
|
if (b == 0) GEN ("};\n");
|
else GEN (",\n");
|
else GEN (",\n");
|
}
|
}
|
|
|
GEN ("\n/* Register the bb_start */\n");
|
GEN ("\n/* Register the bb_start */\n");
|