Keep the width information for all the tran gates.
Update the compiler to keep the actual width information for all the tran gates.
This commit is contained in:
parent
142f661737
commit
ba4137d1e8
18
elaborate.cc
18
elaborate.cc
|
|
@ -524,7 +524,8 @@ NetNode* PGBuiltin::create_gate_for_output_(Design*des, NetScope*scope,
|
|||
<< "tran device." << endl;
|
||||
des->errors += 1;
|
||||
} else {
|
||||
gate = new NetTran(scope, inst_name, IVL_SW_TRAN);
|
||||
gate = new NetTran(scope, inst_name, IVL_SW_TRAN,
|
||||
instance_width);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -534,7 +535,8 @@ NetNode* PGBuiltin::create_gate_for_output_(Design*des, NetScope*scope,
|
|||
<< "rtran device." << endl;
|
||||
des->errors += 1;
|
||||
} else {
|
||||
gate = new NetTran(scope, inst_name, IVL_SW_RTRAN);
|
||||
gate = new NetTran(scope, inst_name, IVL_SW_RTRAN,
|
||||
instance_width);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -544,7 +546,8 @@ NetNode* PGBuiltin::create_gate_for_output_(Design*des, NetScope*scope,
|
|||
<< "tranif0 device." << endl;
|
||||
des->errors += 1;
|
||||
} else {
|
||||
gate = new NetTran(scope, inst_name, IVL_SW_TRANIF0);
|
||||
gate = new NetTran(scope, inst_name, IVL_SW_TRANIF0,
|
||||
instance_width);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -554,7 +557,8 @@ NetNode* PGBuiltin::create_gate_for_output_(Design*des, NetScope*scope,
|
|||
<< "rtranif0 device." << endl;
|
||||
des->errors += 1;
|
||||
} else {
|
||||
gate = new NetTran(scope, inst_name, IVL_SW_RTRANIF0);
|
||||
gate = new NetTran(scope, inst_name, IVL_SW_RTRANIF0,
|
||||
instance_width);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -564,7 +568,8 @@ NetNode* PGBuiltin::create_gate_for_output_(Design*des, NetScope*scope,
|
|||
<< "tranif1 device." << endl;
|
||||
des->errors += 1;
|
||||
} else {
|
||||
gate = new NetTran(scope, inst_name, IVL_SW_TRANIF1);
|
||||
gate = new NetTran(scope, inst_name, IVL_SW_TRANIF1,
|
||||
instance_width);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -574,7 +579,8 @@ NetNode* PGBuiltin::create_gate_for_output_(Design*des, NetScope*scope,
|
|||
<< "rtranif1 device." << endl;
|
||||
des->errors += 1;
|
||||
} else {
|
||||
gate = new NetTran(scope, inst_name, IVL_SW_RTRANIF1);
|
||||
gate = new NetTran(scope, inst_name, IVL_SW_RTRANIF1,
|
||||
instance_width);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,15 +42,15 @@ static bool has_enable(ivl_switch_type_t tt)
|
|||
}
|
||||
}
|
||||
|
||||
NetTran::NetTran(NetScope*scope__, perm_string n, ivl_switch_type_t tt)
|
||||
: NetNode(scope__, n, has_enable(tt)? 3 : 2), type_(tt)
|
||||
NetTran::NetTran(NetScope*scope__, perm_string n, ivl_switch_type_t tt,
|
||||
unsigned width)
|
||||
: NetNode(scope__, n, has_enable(tt)? 3 : 2), type_(tt), wid_(width)
|
||||
{
|
||||
pin(0).set_dir(Link::PASSIVE);
|
||||
pin(1).set_dir(Link::PASSIVE);
|
||||
if (pin_count() == 3) {
|
||||
pin(2).set_dir(Link::INPUT); // Enable
|
||||
}
|
||||
wid_ = 0;
|
||||
part_ = 0;
|
||||
off_ = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1613,7 +1613,8 @@ class NetTran : public NetNode, public IslandBranch {
|
|||
|
||||
public:
|
||||
// Tran devices other than TRAN_VP
|
||||
NetTran(NetScope*scope, perm_string n, ivl_switch_type_t type);
|
||||
NetTran(NetScope*scope, perm_string n, ivl_switch_type_t type,
|
||||
unsigned wid);
|
||||
// Create a TRAN_VP
|
||||
NetTran(NetScope*scope, perm_string n, unsigned wid,
|
||||
unsigned part, unsigned off);
|
||||
|
|
|
|||
3
t-dll.cc
3
t-dll.cc
|
|
@ -963,7 +963,7 @@ bool dll_target::tran(const NetTran*net)
|
|||
{
|
||||
struct ivl_switch_s*obj = new struct ivl_switch_s;
|
||||
obj->type = net->type();
|
||||
obj->width = 0;
|
||||
obj->width = net->vector_width();
|
||||
obj->part = 0;
|
||||
obj->offset = 0;
|
||||
obj->name = net->name();
|
||||
|
|
@ -996,7 +996,6 @@ bool dll_target::tran(const NetTran*net)
|
|||
}
|
||||
|
||||
if (obj->type == IVL_SW_TRAN_VP) {
|
||||
obj->width = net->vector_width();
|
||||
obj->part = net->part_width();
|
||||
obj->offset= net->part_offset();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue