link_design use verilog library to lookup top
This commit is contained in:
parent
389b9b8276
commit
344394de29
|
|
@ -384,7 +384,7 @@ set(STA_HEADERS
|
||||||
util/Vector.hh
|
util/Vector.hh
|
||||||
util/Zlib.hh
|
util/Zlib.hh
|
||||||
|
|
||||||
verilog/Verilog.hh
|
verilog/VerilogReaderPvt.hh
|
||||||
verilog/VerilogReader.hh
|
verilog/VerilogReader.hh
|
||||||
verilog/VerilogWriter.hh
|
verilog/VerilogWriter.hh
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1841,15 +1841,8 @@ ConcreteNetwork::linkNetwork(const char *top_cell_name,
|
||||||
if (link_func_) {
|
if (link_func_) {
|
||||||
clearConstantNets();
|
clearConstantNets();
|
||||||
deleteTopInstance();
|
deleteTopInstance();
|
||||||
Cell *top_cell = findAnyCell(top_cell_name);
|
top_instance_ = link_func_(top_cell_name, make_black_boxes, report, this);
|
||||||
if (top_cell) {
|
return top_instance_ != nullptr;
|
||||||
top_instance_ = link_func_(top_cell, make_black_boxes, report, this);
|
|
||||||
return top_instance_ != nullptr;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
report->error("cell %s not found.\n", top_cell_name);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
report->error("cell type %s can not be linked.\n", top_cell_name);
|
report->error("cell type %s can not be linked.\n", top_cell_name);
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ typedef Set<const Net*> ConstNetSet;
|
||||||
typedef Map<const char*, LibertyLibrary*, CharPtrLess> LibertyLibraryMap;
|
typedef Map<const char*, LibertyLibrary*, CharPtrLess> LibertyLibraryMap;
|
||||||
// Link network function returns top level instance.
|
// Link network function returns top level instance.
|
||||||
// Return nullptr if link fails.
|
// Return nullptr if link fails.
|
||||||
typedef Instance *(LinkNetworkFunc)(Cell *top_cell,
|
typedef Instance *(LinkNetworkFunc)(const char *top_cell_name,
|
||||||
bool make_black_boxes,
|
bool make_black_boxes,
|
||||||
Report *report,
|
Report *report,
|
||||||
NetworkReader *network);
|
NetworkReader *network);
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
#include "Machine.hh"
|
#include "Machine.hh"
|
||||||
#include "Debug.hh"
|
#include "Debug.hh"
|
||||||
#include "VerilogNamespace.hh"
|
#include "VerilogNamespace.hh"
|
||||||
#include "Verilog.hh"
|
#include "VerilogReaderPvt.hh"
|
||||||
#include "VerilogParse.hh"
|
#include "VerilogParse.hh"
|
||||||
|
|
||||||
#define YY_NO_INPUT
|
#define YY_NO_INPUT
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "Machine.hh"
|
#include "Machine.hh"
|
||||||
#include "PortDirection.hh"
|
#include "PortDirection.hh"
|
||||||
#include "Verilog.hh"
|
#include "VerilogReaderPvt.hh"
|
||||||
#include "VerilogReader.hh"
|
#include "VerilogReader.hh"
|
||||||
|
|
||||||
int VerilogLex_lex();
|
int VerilogLex_lex();
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
#include "Liberty.hh"
|
#include "Liberty.hh"
|
||||||
#include "Network.hh"
|
#include "Network.hh"
|
||||||
#include "VerilogNamespace.hh"
|
#include "VerilogNamespace.hh"
|
||||||
#include "Verilog.hh"
|
#include "VerilogReaderPvt.hh"
|
||||||
#include "VerilogReader.hh"
|
#include "VerilogReader.hh"
|
||||||
|
|
||||||
extern int
|
extern int
|
||||||
|
|
@ -47,7 +47,7 @@ hierarchyLevel(Net *net,
|
||||||
Network *network);
|
Network *network);
|
||||||
// Return top level instance.
|
// Return top level instance.
|
||||||
Instance *
|
Instance *
|
||||||
linkVerilogNetwork(Cell *top_cell,
|
linkVerilogNetwork(const char *top_cell_name,
|
||||||
bool make_black_boxes,
|
bool make_black_boxes,
|
||||||
Report *report,
|
Report *report,
|
||||||
NetworkReader *network);
|
NetworkReader *network);
|
||||||
|
|
@ -1684,10 +1684,12 @@ VerilogNetPortRefPart::name()
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
Instance *
|
Instance *
|
||||||
linkVerilogNetwork(Cell *top_cell, bool make_black_boxes,
|
linkVerilogNetwork(const char *top_cell_name,
|
||||||
Report *report, NetworkReader *)
|
bool make_black_boxes,
|
||||||
|
Report *report,
|
||||||
|
NetworkReader *)
|
||||||
{
|
{
|
||||||
return verilog_reader->linkNetwork(top_cell, make_black_boxes, report);
|
return verilog_reader->linkNetwork(top_cell_name, make_black_boxes, report);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verilog net name to network net map.
|
// Verilog net name to network net map.
|
||||||
|
|
@ -1715,10 +1717,11 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
Instance *
|
Instance *
|
||||||
VerilogReader::linkNetwork(Cell *top_cell,
|
VerilogReader::linkNetwork(const char *top_cell_name,
|
||||||
bool make_black_boxes,
|
bool make_black_boxes,
|
||||||
Report *report)
|
Report *report)
|
||||||
{
|
{
|
||||||
|
Cell *top_cell = network_->findCell(library_, top_cell_name);
|
||||||
VerilogModule *module = verilog_reader->module(top_cell);
|
VerilogModule *module = verilog_reader->module(top_cell);
|
||||||
if (module) {
|
if (module) {
|
||||||
// Seed the recursion for expansion with the top level instance.
|
// Seed the recursion for expansion with the top level instance.
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ public:
|
||||||
int from_index,
|
int from_index,
|
||||||
int to_index);
|
int to_index);
|
||||||
VerilogModule *module(Cell *cell);
|
VerilogModule *module(Cell *cell);
|
||||||
Instance *linkNetwork(Cell *top_cell,
|
Instance *linkNetwork(const char *top_cell_name,
|
||||||
bool make_black_boxes,
|
bool make_black_boxes,
|
||||||
Report *report);
|
Report *report);
|
||||||
int line() const { return line_; }
|
int line() const { return line_; }
|
||||||
Loading…
Reference in New Issue