Collect analog branches into islands.
Discipline islands all along were intended to carry collections of analog branches, as well as the current switch modeling support.
This commit is contained in:
parent
988fc70368
commit
0da27a2f45
|
|
@ -678,7 +678,7 @@ void NetTaskDef::dump(ostream&o, unsigned ind) const
|
||||||
void NetTran::dump_node(ostream&o, unsigned ind) const
|
void NetTran::dump_node(ostream&o, unsigned ind) const
|
||||||
{
|
{
|
||||||
o << setw(ind) << "" << type_ << " " << name()
|
o << setw(ind) << "" << type_ << " " << name()
|
||||||
<< " island " << island;
|
<< " island " << get_island();
|
||||||
if (type_ == IVL_SW_TRAN_VP) {
|
if (type_ == IVL_SW_TRAN_VP) {
|
||||||
o << " width=" << vector_width()
|
o << " width=" << vector_width()
|
||||||
<< " part=" << part_width()
|
<< " part=" << part_width()
|
||||||
|
|
|
||||||
|
|
@ -1254,6 +1254,7 @@ NetExpr* PECallFunction::elaborate_access_func_(Design*des, NetScope*scope,
|
||||||
branch = new NetBranch(dis);
|
branch = new NetBranch(dis);
|
||||||
branch->set_line(*this);
|
branch->set_line(*this);
|
||||||
connect(branch->pin(0), sig->pin(0));
|
connect(branch->pin(0), sig->pin(0));
|
||||||
|
join_island(branch);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ivl_assert(*this, 0);
|
ivl_assert(*this, 0);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef __ivl_target_priv_H
|
#ifndef __ivl_target_priv_H
|
||||||
#define __ivl_target_H
|
#define __ivl_target_priv_H
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 2008 Stephen Williams (steve@icarus.com)
|
||||||
*
|
*
|
||||||
|
|
@ -33,10 +33,10 @@
|
||||||
* have disciplines and do not belong to islands.
|
* have disciplines and do not belong to islands.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class discipline_t;
|
class ivl_discipline_s;
|
||||||
|
|
||||||
struct ivl_island_s {
|
struct ivl_island_s {
|
||||||
discipline_t*discipline;
|
ivl_discipline_s*discipline;
|
||||||
// user accessible flags. They are initially false, always.
|
// user accessible flags. They are initially false, always.
|
||||||
vector<bool> flags;
|
vector<bool> flags;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
25
net_tran.cc
25
net_tran.cc
|
|
@ -78,7 +78,7 @@ unsigned NetTran::part_offset() const
|
||||||
return off_;
|
return off_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void join_island(NetObj*obj)
|
void join_island(NetPins*obj)
|
||||||
{
|
{
|
||||||
IslandBranch*branch = dynamic_cast<IslandBranch*> (obj);
|
IslandBranch*branch = dynamic_cast<IslandBranch*> (obj);
|
||||||
|
|
||||||
|
|
@ -88,7 +88,7 @@ void join_island(NetObj*obj)
|
||||||
|
|
||||||
// If this is a branch, but already given to an island, then
|
// If this is a branch, but already given to an island, then
|
||||||
// stop.
|
// stop.
|
||||||
if (branch->island)
|
if (branch->island_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
list<NetObj*> uncommitted_neighbors;
|
list<NetObj*> uncommitted_neighbors;
|
||||||
|
|
@ -110,31 +110,32 @@ void join_island(NetObj*obj)
|
||||||
if (tmp == obj)
|
if (tmp == obj)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If tmb is not a branch, then skip it.
|
// If tmp is not a branch, then skip it.
|
||||||
IslandBranch*tmp_branch = dynamic_cast<IslandBranch*> (tmp);
|
IslandBranch*tmp_branch = dynamic_cast<IslandBranch*> (tmp);
|
||||||
if (tmp_branch == 0)
|
if (tmp_branch == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If that is an uncommitted branch, then save
|
// If tmp is an uncommitted branch, then save
|
||||||
// it. When I finally choose an island for self,
|
// it. When I finally choose an island for self,
|
||||||
// these branches will be scanned so that they join
|
// these branches will be scanned so that they join
|
||||||
// this island as well.
|
// this island as well.
|
||||||
if (tmp_branch->island == 0) {
|
if (tmp_branch->island_ == 0) {
|
||||||
uncommitted_neighbors.push_back(tmp);
|
uncommitted_neighbors.push_back(tmp);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ivl_assert(*obj, branch->island==0 || branch->island==tmp_branch->island);
|
ivl_assert(*obj, branch->island_==0 || branch->island_==tmp_branch->island_);
|
||||||
|
|
||||||
// We found an existing island to join. Join it
|
// We found an existing island to join. Join it
|
||||||
// now. Keep scanning in order to find more neighbors.
|
// now. Keep scanning in order to find more neighbors.
|
||||||
if (branch->island == 0) {
|
if (branch->island_ == 0) {
|
||||||
if (debug_elaborate)
|
if (debug_elaborate)
|
||||||
cerr << obj->get_fileline() << ": debug: "
|
cerr << obj->get_fileline() << ": debug: "
|
||||||
<< "Join branch to existing island." << endl;
|
<< "Join branch to existing island." << endl;
|
||||||
branch->island = tmp_branch->island;
|
branch->island_ = tmp_branch->island_;
|
||||||
|
ivl_assert(*obj, branch->island_->discipline == tmp_branch->island_->discipline);
|
||||||
|
|
||||||
} else if (branch->island != tmp_branch->island) {
|
} else if (branch->island_ != tmp_branch->island_) {
|
||||||
cerr << obj->get_fileline() << ": internal error: "
|
cerr << obj->get_fileline() << ": internal error: "
|
||||||
<< "Oops, Found 2 neighboring islands." << endl;
|
<< "Oops, Found 2 neighboring islands." << endl;
|
||||||
ivl_assert(*obj, 0);
|
ivl_assert(*obj, 0);
|
||||||
|
|
@ -144,9 +145,9 @@ void join_island(NetObj*obj)
|
||||||
|
|
||||||
// If after all that we did not find an island to join, then
|
// If after all that we did not find an island to join, then
|
||||||
// start the island not and join it.
|
// start the island not and join it.
|
||||||
if (branch->island == 0) {
|
if (branch->island_ == 0) {
|
||||||
branch->island = new ivl_island_s;
|
branch->island_ = new ivl_island_s;
|
||||||
branch->island->discipline = 0;
|
branch->island_->discipline = branch->discipline_;
|
||||||
if (debug_elaborate)
|
if (debug_elaborate)
|
||||||
cerr << obj->get_fileline() << ": debug: "
|
cerr << obj->get_fileline() << ": debug: "
|
||||||
<< "Create new island for this branch" << endl;
|
<< "Create new island for this branch" << endl;
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,7 @@ NetNode::~NetNode()
|
||||||
}
|
}
|
||||||
|
|
||||||
NetBranch::NetBranch(ivl_discipline_t dis)
|
NetBranch::NetBranch(ivl_discipline_t dis)
|
||||||
: NetPins(2), discipline_(dis)
|
: NetPins(2), IslandBranch(dis)
|
||||||
{
|
{
|
||||||
pin(0).set_dir(Link::PASSIVE);
|
pin(0).set_dir(Link::PASSIVE);
|
||||||
pin(1).set_dir(Link::PASSIVE);
|
pin(1).set_dir(Link::PASSIVE);
|
||||||
|
|
|
||||||
17
netlist.h
17
netlist.h
|
|
@ -55,6 +55,7 @@ class NetEvent;
|
||||||
class NetNet;
|
class NetNet;
|
||||||
class NetNode;
|
class NetNode;
|
||||||
class NetObj;
|
class NetObj;
|
||||||
|
class NetPins;
|
||||||
class NetProc;
|
class NetProc;
|
||||||
class NetProcTop;
|
class NetProcTop;
|
||||||
class NetRelease;
|
class NetRelease;
|
||||||
|
|
@ -74,7 +75,7 @@ struct functor_t;
|
||||||
|
|
||||||
ostream& operator << (ostream&o, ivl_variable_type_t val);
|
ostream& operator << (ostream&o, ivl_variable_type_t val);
|
||||||
|
|
||||||
extern void join_island(NetObj*obj);
|
extern void join_island(NetPins*obj);
|
||||||
|
|
||||||
class NetPins : public LineInfo {
|
class NetPins : public LineInfo {
|
||||||
|
|
||||||
|
|
@ -154,10 +155,15 @@ class NetObj : public NetPins, public Attrib {
|
||||||
|
|
||||||
class IslandBranch {
|
class IslandBranch {
|
||||||
public:
|
public:
|
||||||
IslandBranch() : island(0) { }
|
IslandBranch(ivl_discipline_t dis =0) : island_(0), discipline_(dis) { }
|
||||||
|
|
||||||
public:
|
ivl_island_t get_island() const { return island_; }
|
||||||
struct ivl_island_s* island;
|
|
||||||
|
friend void join_island(NetPins*);
|
||||||
|
|
||||||
|
private:
|
||||||
|
ivl_island_t island_;
|
||||||
|
ivl_discipline_t discipline_;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -168,7 +174,7 @@ class IslandBranch {
|
||||||
* potential. Pin(1) is the sink of flow and the minus (or ground) of
|
* potential. Pin(1) is the sink of flow and the minus (or ground) of
|
||||||
* potential.
|
* potential.
|
||||||
*/
|
*/
|
||||||
class NetBranch : public NetPins {
|
class NetBranch : public NetPins, public IslandBranch {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit NetBranch(ivl_discipline_t dis);
|
explicit NetBranch(ivl_discipline_t dis);
|
||||||
|
|
@ -176,7 +182,6 @@ class NetBranch : public NetPins {
|
||||||
~NetBranch();
|
~NetBranch();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ivl_discipline_t discipline_;
|
|
||||||
perm_string name_;
|
perm_string name_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
2
t-dll.cc
2
t-dll.cc
|
|
@ -1051,7 +1051,7 @@ bool dll_target::tran(const NetTran*net)
|
||||||
obj->offset = 0;
|
obj->offset = 0;
|
||||||
obj->name = net->name();
|
obj->name = net->name();
|
||||||
obj->scope = find_scope(des_, net->scope());
|
obj->scope = find_scope(des_, net->scope());
|
||||||
obj->island = net->island;
|
obj->island = net->get_island();
|
||||||
assert(obj->scope);
|
assert(obj->scope);
|
||||||
assert(obj->island);
|
assert(obj->island);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue