increase and check max level
This commit is contained in:
parent
df8790486b
commit
dccf03e157
|
|
@ -192,6 +192,9 @@ public:
|
|||
void removeDelaySlewAnnotations();
|
||||
VertexSet *regClkVertices() { return ®_clk_vertices_; }
|
||||
|
||||
static const int vertex_level_bits = 24;
|
||||
static const int vertex_level_max = (1<<vertex_level_bits)-1;
|
||||
|
||||
protected:
|
||||
void makeVerticesAndEdges();
|
||||
Vertex *makeVertex(Pin *pin,
|
||||
|
|
@ -348,7 +351,7 @@ protected:
|
|||
unsigned int slew_annotated_:slew_annotated_bits;
|
||||
|
||||
// 4 bytes (32 bits)
|
||||
unsigned int level_:16;
|
||||
unsigned int level_:Graph::vertex_level_bits;
|
||||
// Levelization search state.
|
||||
// LevelColor gcc barfs if this is dcl'd.
|
||||
unsigned color_:2;
|
||||
|
|
|
|||
|
|
@ -215,6 +215,8 @@ Levelize::visit(Vertex *vertex,
|
|||
setLevel(vertex, level);
|
||||
max_level_ = max(level, max_level_);
|
||||
level += level_space;
|
||||
if (level >= Graph::vertex_level_max)
|
||||
criticalError(616, "maximum logic level exceeded");
|
||||
|
||||
if (search_pred_->searchFrom(vertex)) {
|
||||
VertexOutEdgeIterator edge_iter(vertex, graph_);
|
||||
|
|
@ -226,7 +228,7 @@ Levelize::visit(Vertex *vertex,
|
|||
LevelColor to_color = to_vertex->color();
|
||||
if (to_color == LevelColor::gray)
|
||||
// Back edges form feedback loops.
|
||||
recordLoop(edge, path);
|
||||
recordLoop(edge, path);
|
||||
else if (to_color == LevelColor::white
|
||||
|| to_vertex->level() < level) {
|
||||
path.push_back(edge);
|
||||
|
|
@ -250,6 +252,20 @@ Levelize::visit(Vertex *vertex,
|
|||
vertex->setColor(LevelColor::black);
|
||||
}
|
||||
|
||||
void
|
||||
Levelize::reportPath(EdgeSeq &path) const
|
||||
{
|
||||
bool first_edge = true;
|
||||
EdgeSeq::Iterator edge_iter(path);
|
||||
while (edge_iter.hasNext()) {
|
||||
Edge *edge = edge_iter.next();
|
||||
if (first_edge)
|
||||
report_->reportLine(" %s", edge->from(graph_)->name(network_));
|
||||
report_->reportLine(" %s", edge->to(graph_)->name(network_));
|
||||
first_edge = false;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Levelize::recordLoop(Edge *edge,
|
||||
EdgeSeq &path)
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ protected:
|
|||
void ensureLatchLevels();
|
||||
void setLevel(Vertex *vertex,
|
||||
Level level);
|
||||
void reportPath(EdgeSeq &path) const;
|
||||
|
||||
SearchPred *search_pred_;
|
||||
bool levelized_;
|
||||
|
|
|
|||
Loading…
Reference in New Issue