diff --git a/ivl_target.h b/ivl_target.h index 3def93d62..920330abd 100644 --- a/ivl_target.h +++ b/ivl_target.h @@ -1,7 +1,7 @@ #ifndef __ivl_target_H #define __ivl_target_H /* - * Copyright (c) 2000-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2011 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -1353,11 +1353,6 @@ extern const char*ivl_lpm_string(ivl_lpm_t net); * * (Should this be combined with ivl_lval_idx? -Ed) * - * ivl_lval_mem (deprecated) - * If the l-value is a memory, this method returns an - * ivl_memory_t that represents that memory. Otherwise, it - * returns 0. - * * ivl_lval_sig * If the l-value is a variable, this method returns the signal * object that is the target of the assign. @@ -1383,13 +1378,6 @@ extern const char*ivl_lpm_string(ivl_lpm_t net); * The ivl_lval_part_off is the canonical base of a part or * bit select. * - * - Memory words (Replace this with Array words below) - * If the l-value is a memory word, the ivl_lval_mem function returns - * a non-nil value. The ivl_lval_idx function will return an - * expression that calculates an address for the memory. The compiler - * will assure that the ivl_lval_width will exactly match the - * ivl_memory_width of the memory word. - * * - Array words * If the l-value is an array, then ivl_lval_idx function will return * an expression that calculates the address of the array word. If diff --git a/netlist.cc b/netlist.cc index 30f06102f..05e3899a0 100644 --- a/netlist.cc +++ b/netlist.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 1998-2011 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -2545,7 +2545,7 @@ unsigned NetTaskDef::port_count() const return ports_.count(); } -NetNet* NetTaskDef::port(unsigned idx) +NetNet* NetTaskDef::port(unsigned idx) const { assert(idx < ports_.count()); return ports_[idx]; diff --git a/netlist.h b/netlist.h index 7a1ee9391..859173702 100644 --- a/netlist.h +++ b/netlist.h @@ -1,7 +1,7 @@ #ifndef __netlist_H #define __netlist_H /* - * Copyright (c) 1998-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 1998-2011 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -3088,7 +3088,7 @@ class NetTaskDef { const NetProc*proc() const; unsigned port_count() const; - NetNet*port(unsigned idx); + NetNet*port(unsigned idx) const; void dump(ostream&, unsigned) const; DelayType delay_type() const; diff --git a/t-dll-api.cc b/t-dll-api.cc index c98f9b919..9e2be7228 100644 --- a/t-dll-api.cc +++ b/t-dll-api.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2011 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -1851,14 +1851,16 @@ extern "C" ivl_scope_t ivl_scope_parent(ivl_scope_t net) extern "C" unsigned ivl_scope_ports(ivl_scope_t net) { assert(net); - assert(net->type_ == IVL_SCT_FUNCTION); - return net->ports; + if (net->type_ == IVL_SCT_FUNCTION || + net->type_ == IVL_SCT_TASK) return net->ports; + return 0; } extern "C" ivl_signal_t ivl_scope_port(ivl_scope_t net, unsigned idx) { assert(net); - assert(net->type_ == IVL_SCT_FUNCTION); + assert(net->type_ == IVL_SCT_FUNCTION || + net->type_ == IVL_SCT_TASK); assert(idx < net->ports); return net->port[idx]; } diff --git a/t-dll-proc.cc b/t-dll-proc.cc index e446f9653..0db09dcae 100644 --- a/t-dll-proc.cc +++ b/t-dll-proc.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2011 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -86,6 +86,13 @@ void dll_target::task_def(const NetScope*net) scop->def = stmt_cur_; stmt_cur_ = 0; + scop->ports = def->port_count(); + if (scop->ports > 0) { + scop->port = new ivl_signal_t[scop->ports]; + for (unsigned idx = 0 ; idx < scop->ports ; idx += 1) + scop->port[idx] = find_signal(des_, def->port(idx)); + } + } bool dll_target::func_def(const NetScope*net)