Add support for memory words in l-value of
non-blocking assignments, and remove the special NetAssignMem_ and NetAssignMemNB classes.
This commit is contained in:
parent
4bac5c06ba
commit
53d8cdd9f8
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: design_dump.cc,v 1.125 2002/06/04 05:38:44 steve Exp $"
|
||||
#ident "$Id: design_dump.cc,v 1.126 2002/06/05 03:44:25 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -477,16 +477,6 @@ void NetAssignNB::dump(ostream&o, unsigned ind) const
|
|||
|
||||
}
|
||||
|
||||
void NetAssignMemNB::dump(ostream&o, unsigned ind) const
|
||||
{
|
||||
o << setw(ind) << "";
|
||||
o << "/* " << get_line() << " */" << endl;
|
||||
o << setw(ind) << "";
|
||||
o << memory()->name() << "[" << *index() << "] <= ";
|
||||
rval()->dump(o);
|
||||
o << ";" << endl;
|
||||
}
|
||||
|
||||
/* Dump a block statement */
|
||||
void NetBlock::dump(ostream&o, unsigned ind) const
|
||||
{
|
||||
|
|
@ -975,6 +965,11 @@ void Design::dump(ostream&o) const
|
|||
|
||||
/*
|
||||
* $Log: design_dump.cc,v $
|
||||
* Revision 1.126 2002/06/05 03:44:25 steve
|
||||
* Add support for memory words in l-value of
|
||||
* non-blocking assignments, and remove the special
|
||||
* NetAssignMem_ and NetAssignMemNB classes.
|
||||
*
|
||||
* Revision 1.125 2002/06/04 05:38:44 steve
|
||||
* Add support for memory words in l-value of
|
||||
* blocking assignments, and remove the special
|
||||
|
|
|
|||
49
elaborate.cc
49
elaborate.cc
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: elaborate.cc,v 1.252 2002/06/04 05:38:44 steve Exp $"
|
||||
#ident "$Id: elaborate.cc,v 1.253 2002/06/05 03:44:25 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -1050,36 +1050,6 @@ NetProc* PAssign::elaborate(Design*des, NetScope*scope) const
|
|||
return cur;
|
||||
}
|
||||
|
||||
/*
|
||||
* I do not really know how to elaborate mem[x] <= expr, so this
|
||||
* method pretends it is a blocking assign and elaborates
|
||||
* that. However, I report an error so that the design isn't actually
|
||||
* executed by anyone.
|
||||
*/
|
||||
NetProc* PAssignNB::assign_to_memory_(NetMemory*mem, PExpr*ix,
|
||||
Design*des, NetScope*scope) const
|
||||
{
|
||||
assert(scope);
|
||||
|
||||
/* Elaborate the r-value expression, ... */
|
||||
NetExpr*rv = rval()->elaborate_expr(des, scope);
|
||||
if (rv == 0)
|
||||
return 0;
|
||||
|
||||
assert(rv);
|
||||
rv->set_width(mem->width());
|
||||
|
||||
/* Elaborate the expression to calculate the index, ... */
|
||||
NetExpr*idx = ix->elaborate_expr(des, scope);
|
||||
assert(idx);
|
||||
|
||||
/* And connect them together in an assignment NetProc. */
|
||||
NetAssignMemNB*am = new NetAssignMemNB(mem, idx, rv);
|
||||
am->set_line(*this);
|
||||
|
||||
return am;
|
||||
}
|
||||
|
||||
/*
|
||||
* The l-value of a procedural assignment is a very much constrained
|
||||
* expression. To wit, only identifiers, bit selects and part selects
|
||||
|
|
@ -1092,18 +1062,6 @@ NetProc* PAssignNB::elaborate(Design*des, NetScope*scope) const
|
|||
{
|
||||
assert(scope);
|
||||
|
||||
/* Catch the case where the lvalue is a reference to a memory
|
||||
item. These are handled differently. */
|
||||
do {
|
||||
const PEIdent*id = dynamic_cast<const PEIdent*>(lval());
|
||||
if (id == 0) break;
|
||||
|
||||
if (NetMemory*mem = des->find_memory(scope, id->path()))
|
||||
return assign_to_memory_(mem, id->msb_, des, scope);
|
||||
|
||||
} while(0);
|
||||
|
||||
|
||||
NetAssign_*lv = elaborate_lval(des, scope);
|
||||
if (lv == 0) return 0;
|
||||
|
||||
|
|
@ -2506,6 +2464,11 @@ Design* elaborate(list<const char*>roots)
|
|||
|
||||
/*
|
||||
* $Log: elaborate.cc,v $
|
||||
* Revision 1.253 2002/06/05 03:44:25 steve
|
||||
* Add support for memory words in l-value of
|
||||
* non-blocking assignments, and remove the special
|
||||
* NetAssignMem_ and NetAssignMemNB classes.
|
||||
*
|
||||
* Revision 1.252 2002/06/04 05:38:44 steve
|
||||
* Add support for memory words in l-value of
|
||||
* blocking assignments, and remove the special
|
||||
|
|
|
|||
13
emit.cc
13
emit.cc
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: emit.cc,v 1.67 2002/06/04 05:38:44 steve Exp $"
|
||||
#ident "$Id: emit.cc,v 1.68 2002/06/05 03:44:25 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -161,12 +161,6 @@ bool NetAssignNB::emit_proc(struct target_t*tgt) const
|
|||
return true;
|
||||
}
|
||||
|
||||
bool NetAssignMemNB::emit_proc(struct target_t*tgt) const
|
||||
{
|
||||
tgt->proc_assign_mem_nb(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NetBlock::emit_proc(struct target_t*tgt) const
|
||||
{
|
||||
return tgt->proc_block(this);
|
||||
|
|
@ -481,6 +475,11 @@ bool emit(const Design*des, const char*type)
|
|||
|
||||
/*
|
||||
* $Log: emit.cc,v $
|
||||
* Revision 1.68 2002/06/05 03:44:25 steve
|
||||
* Add support for memory words in l-value of
|
||||
* non-blocking assignments, and remove the special
|
||||
* NetAssignMem_ and NetAssignMemNB classes.
|
||||
*
|
||||
* Revision 1.67 2002/06/04 05:38:44 steve
|
||||
* Add support for memory words in l-value of
|
||||
* blocking assignments, and remove the special
|
||||
|
|
|
|||
17
functor.cc
17
functor.cc
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: functor.cc,v 1.27 2002/06/04 05:38:44 steve Exp $"
|
||||
#ident "$Id: functor.cc,v 1.28 2002/06/05 03:44:25 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -234,16 +234,6 @@ int NetAssignNB::match_proc(proc_match_t*that)
|
|||
return that->assign_nb(this);
|
||||
}
|
||||
|
||||
int proc_match_t::assign_mem_nb(NetAssignMemNB*)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int NetAssignMemNB::match_proc(proc_match_t*that)
|
||||
{
|
||||
return that->assign_mem_nb(this);
|
||||
}
|
||||
|
||||
int proc_match_t::block(NetBlock*)
|
||||
{
|
||||
cerr << "default (failing) match for block" << endl;
|
||||
|
|
@ -278,6 +268,11 @@ int proc_match_t::event_wait(NetEvWait*)
|
|||
|
||||
/*
|
||||
* $Log: functor.cc,v $
|
||||
* Revision 1.28 2002/06/05 03:44:25 steve
|
||||
* Add support for memory words in l-value of
|
||||
* non-blocking assignments, and remove the special
|
||||
* NetAssignMem_ and NetAssignMemNB classes.
|
||||
*
|
||||
* Revision 1.27 2002/06/04 05:38:44 steve
|
||||
* Add support for memory words in l-value of
|
||||
* blocking assignments, and remove the special
|
||||
|
|
|
|||
35
functor.h
35
functor.h
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: functor.h,v 1.18 2002/06/04 05:38:44 steve Exp $"
|
||||
#ident "$Id: functor.h,v 1.19 2002/06/05 03:44:25 steve Exp $"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
@ -84,7 +84,6 @@ struct proc_match_t {
|
|||
|
||||
virtual int assign(class NetAssign*);
|
||||
virtual int assign_nb(class NetAssignNB*);
|
||||
virtual int assign_mem_nb(class NetAssignMemNB*);
|
||||
virtual int condit(class NetCondit*);
|
||||
virtual int event_wait(class NetEvWait*);
|
||||
virtual int block(class NetBlock*);
|
||||
|
|
@ -93,6 +92,11 @@ struct proc_match_t {
|
|||
|
||||
/*
|
||||
* $Log: functor.h,v $
|
||||
* Revision 1.19 2002/06/05 03:44:25 steve
|
||||
* Add support for memory words in l-value of
|
||||
* non-blocking assignments, and remove the special
|
||||
* NetAssignMem_ and NetAssignMemNB classes.
|
||||
*
|
||||
* Revision 1.18 2002/06/04 05:38:44 steve
|
||||
* Add support for memory words in l-value of
|
||||
* blocking assignments, and remove the special
|
||||
|
|
@ -112,32 +116,5 @@ struct proc_match_t {
|
|||
*
|
||||
* Revision 1.13 2000/04/20 00:28:03 steve
|
||||
* Catch some simple identity compareoptimizations.
|
||||
*
|
||||
* Revision 1.12 2000/04/18 04:50:19 steve
|
||||
* Clean up unneeded NetEvent objects.
|
||||
*
|
||||
* Revision 1.11 2000/04/12 20:02:53 steve
|
||||
* Finally remove the NetNEvent and NetPEvent classes,
|
||||
* Get synthesis working with the NetEvWait class,
|
||||
* and get started supporting multiple events in a
|
||||
* wait in vvm.
|
||||
*
|
||||
* Revision 1.10 2000/04/01 21:40:22 steve
|
||||
* Add support for integer division.
|
||||
*
|
||||
* Revision 1.9 2000/02/23 02:56:54 steve
|
||||
* Macintosh compilers do not support ident.
|
||||
*
|
||||
* Revision 1.8 2000/02/13 04:35:43 steve
|
||||
* Include some block matching from Larry.
|
||||
*
|
||||
* Revision 1.7 2000/01/13 03:35:35 steve
|
||||
* Multiplication all the way to simulation.
|
||||
*
|
||||
* Revision 1.6 1999/12/30 04:19:12 steve
|
||||
* Propogate constant 0 in low bits of adders.
|
||||
*
|
||||
* Revision 1.5 1999/12/17 06:18:16 steve
|
||||
* Rewrite the cprop functor to use the functor_t interface.
|
||||
*/
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT)
|
||||
#ident "$Id: net_nex_input.cc,v 1.2 2002/04/21 17:43:12 steve Exp $"
|
||||
#ident "$Id: net_nex_input.cc,v 1.3 2002/06/05 03:44:25 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -173,15 +173,6 @@ NexusSet* NetAssignBase::nex_input()
|
|||
return result;
|
||||
}
|
||||
|
||||
NexusSet* NetAssignMem_::nex_input()
|
||||
{
|
||||
NexusSet*result = rval_->nex_input();
|
||||
NexusSet*tmp = index_->nex_input();
|
||||
result->add(*tmp);
|
||||
delete tmp;
|
||||
return result;
|
||||
}
|
||||
|
||||
NexusSet* NetBlock::nex_input()
|
||||
{
|
||||
if (last_ == 0)
|
||||
|
|
@ -326,6 +317,11 @@ NexusSet* NetWhile::nex_input()
|
|||
|
||||
/*
|
||||
* $Log: net_nex_input.cc,v $
|
||||
* Revision 1.3 2002/06/05 03:44:25 steve
|
||||
* Add support for memory words in l-value of
|
||||
* non-blocking assignments, and remove the special
|
||||
* NetAssignMem_ and NetAssignMemNB classes.
|
||||
*
|
||||
* Revision 1.2 2002/04/21 17:43:12 steve
|
||||
* implement nex_input for behavioral statements.
|
||||
*
|
||||
|
|
|
|||
26
netlist.cc
26
netlist.cc
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: netlist.cc,v 1.189 2002/06/04 05:38:44 steve Exp $"
|
||||
#ident "$Id: netlist.cc,v 1.190 2002/06/05 03:44:25 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -1456,25 +1456,6 @@ const Link& NetRamDq::pin_Q(unsigned idx) const
|
|||
return pin(3+awidth_+width()+idx);
|
||||
}
|
||||
|
||||
NetAssignMem_::NetAssignMem_(NetMemory*m, NetExpr*i, NetExpr*r)
|
||||
: mem_(m), index_(i), rval_(r)
|
||||
{
|
||||
}
|
||||
|
||||
NetAssignMem_::~NetAssignMem_()
|
||||
{
|
||||
}
|
||||
|
||||
NetAssignMemNB::NetAssignMemNB(NetMemory*m, NetExpr*i, NetExpr*r)
|
||||
: NetAssignMem_(m, i, r)
|
||||
{
|
||||
}
|
||||
|
||||
NetAssignMemNB::~NetAssignMemNB()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
NetBlock::NetBlock(Type t, NetScope*ss)
|
||||
: type_(t), subscope_(ss), last_(0)
|
||||
{
|
||||
|
|
@ -2348,6 +2329,11 @@ const NetProc*NetTaskDef::proc() const
|
|||
|
||||
/*
|
||||
* $Log: netlist.cc,v $
|
||||
* Revision 1.190 2002/06/05 03:44:25 steve
|
||||
* Add support for memory words in l-value of
|
||||
* non-blocking assignments, and remove the special
|
||||
* NetAssignMem_ and NetAssignMemNB classes.
|
||||
*
|
||||
* Revision 1.189 2002/06/04 05:38:44 steve
|
||||
* Add support for memory words in l-value of
|
||||
* blocking assignments, and remove the special
|
||||
|
|
|
|||
48
netlist.h
48
netlist.h
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: netlist.h,v 1.240 2002/06/04 05:38:44 steve Exp $"
|
||||
#ident "$Id: netlist.h,v 1.241 2002/06/05 03:44:25 steve Exp $"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
@ -1321,47 +1321,6 @@ class NetAssignNB : public NetAssignBase {
|
|||
private:
|
||||
};
|
||||
|
||||
/*
|
||||
* Assignment to memory is handled separately because memory is
|
||||
* not a node. There are blocking and non-blocking variants, just like
|
||||
* regular assign, and the NetAssignMem_ base class takes care of all
|
||||
* the common stuff.
|
||||
*/
|
||||
class NetAssignMem_ : public NetProc {
|
||||
|
||||
public:
|
||||
explicit NetAssignMem_(NetMemory*, NetExpr*idx, NetExpr*rv);
|
||||
~NetAssignMem_();
|
||||
|
||||
NetMemory*memory() { return mem_; }
|
||||
NetExpr*index() { return index_; }
|
||||
NetExpr*rval() { return rval_; }
|
||||
|
||||
const NetMemory*memory()const { return mem_; }
|
||||
const NetExpr*index()const { return index_; }
|
||||
const NetExpr*rval()const { return rval_; }
|
||||
|
||||
virtual NexusSet* nex_input();
|
||||
|
||||
private:
|
||||
NetMemory*mem_;
|
||||
NetExpr* index_;
|
||||
NetExpr* rval_;
|
||||
};
|
||||
|
||||
class NetAssignMemNB : public NetAssignMem_ {
|
||||
|
||||
public:
|
||||
explicit NetAssignMemNB(NetMemory*, NetExpr*idx, NetExpr*rv);
|
||||
~NetAssignMemNB();
|
||||
|
||||
virtual int match_proc(struct proc_match_t*);
|
||||
virtual bool emit_proc(struct target_t*) const;
|
||||
virtual void dump(ostream&, unsigned ind) const;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
/*
|
||||
* A block is stuff like begin-end blocks, that contain an ordered
|
||||
* list of NetProc statements.
|
||||
|
|
@ -2965,6 +2924,11 @@ extern ostream& operator << (ostream&, NetNet::Type);
|
|||
|
||||
/*
|
||||
* $Log: netlist.h,v $
|
||||
* Revision 1.241 2002/06/05 03:44:25 steve
|
||||
* Add support for memory words in l-value of
|
||||
* non-blocking assignments, and remove the special
|
||||
* NetAssignMem_ and NetAssignMemNB classes.
|
||||
*
|
||||
* Revision 1.240 2002/06/04 05:38:44 steve
|
||||
* Add support for memory words in l-value of
|
||||
* blocking assignments, and remove the special
|
||||
|
|
|
|||
81
syn-rules.y
81
syn-rules.y
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: syn-rules.y,v 1.19 2002/06/04 05:38:44 steve Exp $"
|
||||
#ident "$Id: syn-rules.y,v 1.20 2002/06/05 03:44:25 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -43,7 +43,6 @@ struct syn_token_t {
|
|||
int token;
|
||||
|
||||
NetAssignBase*assign;
|
||||
NetAssignMem_*assign_mem;
|
||||
NetProcTop*top;
|
||||
NetEvWait*evwait;
|
||||
NetEvent*event;
|
||||
|
|
@ -59,8 +58,6 @@ static Design*des_;
|
|||
|
||||
static void make_DFF_CE(Design*des, NetProcTop*top, NetEvWait*wclk,
|
||||
NetEvent*eclk, NetExpr*cexp, NetAssignBase*asn);
|
||||
static void make_RAM_CE(Design*des, NetProcTop*top, NetEvWait*wclk,
|
||||
NetEvent*eclk, NetExpr*cexp, NetAssignMem_*asn);
|
||||
static void make_initializer(Design*des, NetProcTop*top, NetAssignBase*asn);
|
||||
|
||||
%}
|
||||
|
|
@ -104,32 +101,6 @@ start
|
|||
}
|
||||
|
||||
|
||||
/* These rules match RAM devices. They are similar to DFF, except
|
||||
that there is an index for the word. The typical Verilog that get
|
||||
these are:
|
||||
|
||||
always @(posedge CLK) M[a] = D
|
||||
always @(negedge CLK) M[a] = D
|
||||
|
||||
always @(posedge CLK) if (CE) M[a] = D;
|
||||
always @(negedge CLK) if (CE) M[a] = D;
|
||||
|
||||
The width of Q and D cause a wide register to be created. The
|
||||
code generators generally implement that as an array of
|
||||
flip-flops. */
|
||||
|
||||
| S_ALWAYS '@' '(' S_EVENT ')' S_ASSIGN_MEM ';'
|
||||
{ make_RAM_CE(des_, $1->top, $2->evwait, $4->event,
|
||||
0, $6->assign_mem);
|
||||
}
|
||||
|
||||
| S_ALWAYS '@' '(' S_EVENT ')' S_IF S_EXPR S_ASSIGN_MEM ';' ';'
|
||||
{ make_RAM_CE(des_, $1->top, $2->evwait, $4->event,
|
||||
$7->expr, $8->assign_mem);
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
%%
|
||||
|
||||
|
||||
|
|
@ -201,44 +172,6 @@ static void make_DFF_CE(Design*des, NetProcTop*top, NetEvWait*wclk,
|
|||
des->delete_process(top);
|
||||
}
|
||||
|
||||
static void make_RAM_CE(Design*des, NetProcTop*top, NetEvWait*wclk,
|
||||
NetEvent*eclk, NetExpr*cexp, NetAssignMem_*asn)
|
||||
{
|
||||
NetMemory*mem = asn->memory();
|
||||
NetExpr*adr_e = asn->index();
|
||||
|
||||
NetNet*adr = adr_e->synthesize(des);
|
||||
assert(adr);
|
||||
|
||||
NetScope*scope = adr->scope();
|
||||
assert(scope);
|
||||
|
||||
NetEvProbe*pclk = eclk->probe(0);
|
||||
NetESignal*d = dynamic_cast<NetESignal*> (asn->rval());
|
||||
NetNet*ce = cexp? cexp->synthesize(des) : 0;
|
||||
|
||||
assert(d);
|
||||
|
||||
NetRamDq*ram = new NetRamDq(scope, des->local_symbol(mem->name()),
|
||||
mem, adr->pin_count());
|
||||
|
||||
for (unsigned idx = 0 ; idx < adr->pin_count() ; idx += 1)
|
||||
connect(adr->pin(idx), ram->pin_Address(idx));
|
||||
|
||||
for (unsigned idx = 0 ; idx < ram->width() ; idx += 1)
|
||||
connect(ram->pin_Data(idx), d->bit(idx));
|
||||
|
||||
if (ce) connect(ram->pin_WE(), ce->pin(0));
|
||||
|
||||
assert(pclk->edge() == NetEvProbe::POSEDGE);
|
||||
connect(ram->pin_InClock(), pclk->pin(0));
|
||||
|
||||
ram->absorb_partners();
|
||||
|
||||
des->add_node(ram);
|
||||
des->delete_process(top);
|
||||
}
|
||||
|
||||
/*
|
||||
* An assignment in an initial statement is the same as giving the
|
||||
* nexus an initial value. For synthesized netlists, we can just set
|
||||
|
|
@ -304,18 +237,6 @@ struct tokenize : public proc_match_t {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int assign_mem_nb(NetAssignMemNB*dev)
|
||||
{
|
||||
syn_token_t*cur;
|
||||
cur = new syn_token_t;
|
||||
cur->token = S_ASSIGN_MEM;
|
||||
cur->assign_mem = dev;
|
||||
cur->next_ = 0;
|
||||
last_->next_ = cur;
|
||||
last_ = cur;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int condit(NetCondit*dev)
|
||||
{
|
||||
syn_token_t*cur;
|
||||
|
|
|
|||
8
synth.cc
8
synth.cc
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: synth.cc,v 1.12 2001/07/25 03:10:49 steve Exp $"
|
||||
#ident "$Id: synth.cc,v 1.13 2002/06/05 03:44:25 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -46,7 +46,6 @@ class do_expr : public proc_match_t {
|
|||
virtual int assign(NetAssign*);
|
||||
virtual int assign_nb(NetAssignNB*);
|
||||
virtual int event_wait(NetEvWait*);
|
||||
//virtual int assign_mem(NetAssignMem*);
|
||||
virtual int condit(NetCondit*);
|
||||
};
|
||||
|
||||
|
|
@ -163,6 +162,11 @@ void synth(Design*des)
|
|||
|
||||
/*
|
||||
* $Log: synth.cc,v $
|
||||
* Revision 1.13 2002/06/05 03:44:25 steve
|
||||
* Add support for memory words in l-value of
|
||||
* non-blocking assignments, and remove the special
|
||||
* NetAssignMem_ and NetAssignMemNB classes.
|
||||
*
|
||||
* Revision 1.12 2001/07/25 03:10:49 steve
|
||||
* Create a config.h.in file to hold all the config
|
||||
* junk, and support gcc 3.0. (Stephan Boettcher)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: t-dll-proc.cc,v 1.46 2002/06/04 05:38:44 steve Exp $"
|
||||
#ident "$Id: t-dll-proc.cc,v 1.47 2002/06/05 03:44:25 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -201,21 +201,33 @@ void dll_target::proc_assign_nb(const NetAssignNB*net)
|
|||
struct ivl_lval_s*cur = stmt_cur_->u_.assign_.lval_ + idx;
|
||||
const NetAssign_*asn = net->l_val(idx);
|
||||
|
||||
cur->type_ = IVL_LVAL_REG;
|
||||
cur->width_ = asn->lwidth();
|
||||
cur->loff_ = asn->get_loff();
|
||||
assert(asn->sig());
|
||||
cur->n.sig = find_signal(des_, asn->sig());
|
||||
if (asn->sig()) {
|
||||
cur->type_ = IVL_LVAL_REG;
|
||||
cur->n.sig = find_signal(des_, asn->sig());
|
||||
|
||||
cur->idx = 0;
|
||||
if (asn->bmux()) {
|
||||
assert(expr_ == 0);
|
||||
asn->bmux()->expr_scan(this);
|
||||
|
||||
if (asn->sig()->lsb() != 0)
|
||||
sub_off_from_expr_(asn->sig()->lsb());
|
||||
|
||||
cur->type_ = IVL_LVAL_MUX;
|
||||
cur->idx = expr_;
|
||||
expr_ = 0;
|
||||
}
|
||||
} else {
|
||||
assert(asn->mem());
|
||||
cur->type_ = IVL_LVAL_MEM;
|
||||
cur->n.mem = lookup_memory_(asn->mem());
|
||||
assert(cur->n.mem);
|
||||
cur->width_ = ivl_memory_width(cur->n.mem);
|
||||
|
||||
cur->idx = 0;
|
||||
if (asn->bmux()) {
|
||||
assert(expr_ == 0);
|
||||
asn->bmux()->expr_scan(this);
|
||||
|
||||
if (asn->sig()->lsb() != 0)
|
||||
sub_off_from_expr_(asn->sig()->lsb());
|
||||
|
||||
cur->type_ = IVL_LVAL_MUX;
|
||||
cur->idx = expr_;
|
||||
expr_ = 0;
|
||||
}
|
||||
|
|
@ -242,45 +254,6 @@ void dll_target::proc_assign_nb(const NetAssignNB*net)
|
|||
}
|
||||
}
|
||||
|
||||
void dll_target::proc_assign_mem_nb(const NetAssignMemNB*net)
|
||||
{
|
||||
assert(stmt_cur_);
|
||||
assert(stmt_cur_->type_ == IVL_ST_NONE);
|
||||
|
||||
stmt_cur_->type_ = IVL_ST_ASSIGN_NB;
|
||||
|
||||
stmt_cur_->u_.assign_.lvals_ = 1;
|
||||
stmt_cur_->u_.assign_.lval_ = new struct ivl_lval_s[1];
|
||||
stmt_cur_->u_.assign_.delay = 0;
|
||||
struct ivl_lval_s*cur = stmt_cur_->u_.assign_.lval_;
|
||||
|
||||
cur->type_ = IVL_LVAL_MEM;
|
||||
cur->n.mem = lookup_memory_(net->memory());
|
||||
cur->width_ = ivl_memory_width(cur->n.mem);
|
||||
|
||||
assert(expr_ == 0);
|
||||
|
||||
net->index()->expr_scan(this);
|
||||
cur->type_ = IVL_LVAL_MEM;
|
||||
cur->idx = expr_;
|
||||
expr_ = 0;
|
||||
|
||||
net->rval()->expr_scan(this);
|
||||
stmt_cur_->u_.assign_.rval_ = expr_;
|
||||
expr_ = 0;
|
||||
|
||||
unsigned long delay_val = 0;
|
||||
|
||||
if (delay_val > 0) {
|
||||
ivl_expr_t de = new struct ivl_expr_s;
|
||||
de->type_ = IVL_EX_ULONG;
|
||||
de->width_ = 8 * sizeof(unsigned long);
|
||||
de->signed_ = 0;
|
||||
de->u_.ulong_.value = delay_val;
|
||||
stmt_cur_->u_.assign_.delay = de;
|
||||
}
|
||||
}
|
||||
|
||||
bool dll_target::proc_block(const NetBlock*net)
|
||||
{
|
||||
assert(stmt_cur_);
|
||||
|
|
@ -803,6 +776,11 @@ void dll_target::proc_while(const NetWhile*net)
|
|||
|
||||
/*
|
||||
* $Log: t-dll-proc.cc,v $
|
||||
* Revision 1.47 2002/06/05 03:44:25 steve
|
||||
* Add support for memory words in l-value of
|
||||
* non-blocking assignments, and remove the special
|
||||
* NetAssignMem_ and NetAssignMemNB classes.
|
||||
*
|
||||
* Revision 1.46 2002/06/04 05:38:44 steve
|
||||
* Add support for memory words in l-value of
|
||||
* blocking assignments, and remove the special
|
||||
|
|
|
|||
8
t-dll.h
8
t-dll.h
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: t-dll.h,v 1.82 2002/06/04 05:38:44 steve Exp $"
|
||||
#ident "$Id: t-dll.h,v 1.83 2002/06/05 03:44:25 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "target.h"
|
||||
|
|
@ -104,7 +104,6 @@ struct dll_target : public target_t, public expr_scan_t {
|
|||
struct ivl_statement_s*stmt_cur_;
|
||||
void proc_assign(const NetAssign*);
|
||||
void proc_assign_nb(const NetAssignNB*);
|
||||
void proc_assign_mem_nb(const NetAssignMemNB*net);
|
||||
bool proc_block(const NetBlock*);
|
||||
void proc_case(const NetCase*);
|
||||
bool proc_cassign(const NetCAssign*);
|
||||
|
|
@ -604,6 +603,11 @@ struct ivl_statement_s {
|
|||
|
||||
/*
|
||||
* $Log: t-dll.h,v $
|
||||
* Revision 1.83 2002/06/05 03:44:25 steve
|
||||
* Add support for memory words in l-value of
|
||||
* non-blocking assignments, and remove the special
|
||||
* NetAssignMem_ and NetAssignMemNB classes.
|
||||
*
|
||||
* Revision 1.82 2002/06/04 05:38:44 steve
|
||||
* Add support for memory words in l-value of
|
||||
* blocking assignments, and remove the special
|
||||
|
|
|
|||
13
target.cc
13
target.cc
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: target.cc,v 1.61 2002/06/04 05:38:44 steve Exp $"
|
||||
#ident "$Id: target.cc,v 1.62 2002/06/05 03:44:25 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -189,12 +189,6 @@ void target_t::proc_assign_nb(const NetAssignNB*)
|
|||
"Unhandled non-blocking assignment." << endl;
|
||||
}
|
||||
|
||||
void target_t::proc_assign_mem_nb(const NetAssignMemNB*)
|
||||
{
|
||||
cerr << "target (" << typeid(*this).name() << "): "
|
||||
"Unhandled non-blocking memory assignment." << endl;
|
||||
}
|
||||
|
||||
bool target_t::proc_block(const NetBlock*)
|
||||
{
|
||||
cerr << "target (" << typeid(*this).name() << "): "
|
||||
|
|
@ -391,6 +385,11 @@ void expr_scan_t::expr_binary(const NetEBinary*ex)
|
|||
|
||||
/*
|
||||
* $Log: target.cc,v $
|
||||
* Revision 1.62 2002/06/05 03:44:25 steve
|
||||
* Add support for memory words in l-value of
|
||||
* non-blocking assignments, and remove the special
|
||||
* NetAssignMem_ and NetAssignMemNB classes.
|
||||
*
|
||||
* Revision 1.61 2002/06/04 05:38:44 steve
|
||||
* Add support for memory words in l-value of
|
||||
* blocking assignments, and remove the special
|
||||
|
|
|
|||
57
target.h
57
target.h
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#if !defined(WINNT) && !defined(macintosh)
|
||||
#ident "$Id: target.h,v 1.58 2002/06/04 05:38:44 steve Exp $"
|
||||
#ident "$Id: target.h,v 1.59 2002/06/05 03:44:25 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "netlist.h"
|
||||
|
|
@ -101,7 +101,6 @@ struct target_t {
|
|||
/* Various kinds of process nodes are dispatched through these. */
|
||||
virtual void proc_assign(const NetAssign*);
|
||||
virtual void proc_assign_nb(const NetAssignNB*);
|
||||
virtual void proc_assign_mem_nb(const NetAssignMemNB*);
|
||||
virtual bool proc_block(const NetBlock*);
|
||||
virtual void proc_case(const NetCase*);
|
||||
virtual bool proc_cassign(const NetCAssign*);
|
||||
|
|
@ -163,6 +162,11 @@ extern const struct target *target_table[];
|
|||
|
||||
/*
|
||||
* $Log: target.h,v $
|
||||
* Revision 1.59 2002/06/05 03:44:25 steve
|
||||
* Add support for memory words in l-value of
|
||||
* non-blocking assignments, and remove the special
|
||||
* NetAssignMem_ and NetAssignMemNB classes.
|
||||
*
|
||||
* Revision 1.58 2002/06/04 05:38:44 steve
|
||||
* Add support for memory words in l-value of
|
||||
* blocking assignments, and remove the special
|
||||
|
|
@ -195,54 +199,5 @@ extern const struct target *target_table[];
|
|||
*
|
||||
* Revision 1.52 2001/04/22 23:09:46 steve
|
||||
* More UDP consolidation from Stephan Boettcher.
|
||||
*
|
||||
* Revision 1.51 2001/04/06 02:28:02 steve
|
||||
* Generate vvp code for functions with ports.
|
||||
*
|
||||
* Revision 1.50 2001/04/02 02:28:13 steve
|
||||
* Generate code for task calls.
|
||||
*
|
||||
* Revision 1.49 2001/03/27 03:31:06 steve
|
||||
* Support error code from target_t::end_design method.
|
||||
*
|
||||
* Revision 1.48 2000/11/04 01:54:01 steve
|
||||
* Modifications in support of gcc 2.96
|
||||
*
|
||||
* Revision 1.47 2000/09/26 01:35:43 steve
|
||||
* Remove the obsolete NetEIdent class.
|
||||
*
|
||||
* Revision 1.46 2000/09/17 21:26:16 steve
|
||||
* Add support for modulus (Eric Aardoom)
|
||||
*
|
||||
* Revision 1.45 2000/09/02 20:54:21 steve
|
||||
* Rearrange NetAssign to make NetAssign_ separate.
|
||||
*
|
||||
* Revision 1.44 2000/08/27 15:51:51 steve
|
||||
* t-dll iterates signals, and passes them to the
|
||||
* target module.
|
||||
*
|
||||
* Some of NetObj should return char*, not string.
|
||||
*
|
||||
* Revision 1.43 2000/08/14 04:39:57 steve
|
||||
* add th t-dll functions for net_const, net_bufz and processes.
|
||||
*
|
||||
* Revision 1.42 2000/08/09 03:43:45 steve
|
||||
* Move all file manipulation out of target class.
|
||||
*
|
||||
* Revision 1.41 2000/08/08 01:50:42 steve
|
||||
* target methods need not take a file stream.
|
||||
*
|
||||
* Revision 1.40 2000/07/29 16:21:08 steve
|
||||
* Report code generation errors through proc_delay.
|
||||
*
|
||||
* Revision 1.39 2000/07/27 05:13:44 steve
|
||||
* Support elaboration of disable statements.
|
||||
*
|
||||
* Revision 1.38 2000/05/11 23:37:27 steve
|
||||
* Add support for procedural continuous assignment.
|
||||
*
|
||||
* Revision 1.37 2000/05/04 03:37:59 steve
|
||||
* Add infrastructure for system functions, move
|
||||
* $time to that structure and add $random.
|
||||
*/
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue