Allow generate schemes to generate task/function definitions.
Generating task/function definitions involves getting the functions to put themselves into the generate scheme instead of the module, and getting elaboration to elaborate those definitions in the generate scheme.
This commit is contained in:
parent
ce9fd0147f
commit
2f3627cd6d
10
Module.cc
10
Module.cc
|
|
@ -41,16 +41,6 @@ void Module::add_gate(PGate*gate)
|
||||||
gates_.push_back(gate);
|
gates_.push_back(gate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::add_task(perm_string name, PTask*task)
|
|
||||||
{
|
|
||||||
tasks_[name] = task;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Module::add_function(perm_string name, PFunction *func)
|
|
||||||
{
|
|
||||||
funcs_[name] = func;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned Module::port_count() const
|
unsigned Module::port_count() const
|
||||||
{
|
{
|
||||||
return ports.count();
|
return ports.count();
|
||||||
|
|
|
||||||
8
Module.h
8
Module.h
|
|
@ -138,6 +138,10 @@ class Module : public PScope, public LineInfo {
|
||||||
set by the `timescale directive. */
|
set by the `timescale directive. */
|
||||||
int time_unit, time_precision;
|
int time_unit, time_precision;
|
||||||
|
|
||||||
|
/* Task definitions within this module */
|
||||||
|
map<perm_string,PTask*> tasks;
|
||||||
|
map<perm_string,PFunction*> funcs;
|
||||||
|
|
||||||
/* The module has a list of genvars that may be used in
|
/* The module has a list of genvars that may be used in
|
||||||
various generate schemes. */
|
various generate schemes. */
|
||||||
map<perm_string,LineInfo*> genvars;
|
map<perm_string,LineInfo*> genvars;
|
||||||
|
|
@ -152,8 +156,6 @@ class Module : public PScope, public LineInfo {
|
||||||
perm_string mod_name() const { return pscope_name(); }
|
perm_string mod_name() const { return pscope_name(); }
|
||||||
|
|
||||||
void add_gate(PGate*gate);
|
void add_gate(PGate*gate);
|
||||||
void add_task(perm_string name, PTask*def);
|
|
||||||
void add_function(perm_string name, PFunction*def);
|
|
||||||
|
|
||||||
unsigned port_count() const;
|
unsigned port_count() const;
|
||||||
const svector<PEIdent*>& get_port(unsigned idx) const;
|
const svector<PEIdent*>& get_port(unsigned idx) const;
|
||||||
|
|
@ -173,8 +175,6 @@ class Module : public PScope, public LineInfo {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
list<PGate*> gates_;
|
list<PGate*> gates_;
|
||||||
map<perm_string,PTask*> tasks_;
|
|
||||||
map<perm_string,PFunction*> funcs_;
|
|
||||||
|
|
||||||
static void elaborate_parm_item_(perm_string name, const param_expr_t&cur,
|
static void elaborate_parm_item_(perm_string name, const param_expr_t&cur,
|
||||||
Design*des, NetScope*scope);
|
Design*des, NetScope*scope);
|
||||||
|
|
|
||||||
11
PGenerate.h
11
PGenerate.h
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef __PGenerate_H
|
#ifndef __PGenerate_H
|
||||||
#define __PGenerate_H
|
#define __PGenerate_H
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 2006-2008 Stephen Williams (steve@icarus.com)
|
||||||
*
|
*
|
||||||
* This source code is free software; you can redistribute it
|
* This source code is free software; you can redistribute it
|
||||||
* and/or modify it in source code form under the terms of the GNU
|
* and/or modify it in source code form under the terms of the GNU
|
||||||
|
|
@ -18,9 +18,6 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CVS_IDENT
|
|
||||||
#ident "$Id: PGenerate.h,v 1.4 2007/06/02 03:42:12 steve Exp $"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
# include "LineInfo.h"
|
# include "LineInfo.h"
|
||||||
# include "StringHeap.h"
|
# include "StringHeap.h"
|
||||||
|
|
@ -32,7 +29,9 @@
|
||||||
class Design;
|
class Design;
|
||||||
class NetScope;
|
class NetScope;
|
||||||
class PExpr;
|
class PExpr;
|
||||||
|
class PFunction;
|
||||||
class PProcess;
|
class PProcess;
|
||||||
|
class PTask;
|
||||||
class PGate;
|
class PGate;
|
||||||
class PWire;
|
class PWire;
|
||||||
|
|
||||||
|
|
@ -79,6 +78,10 @@ class PGenerate : public LineInfo {
|
||||||
|
|
||||||
list<PProcess*> behaviors;
|
list<PProcess*> behaviors;
|
||||||
|
|
||||||
|
// Tasks instantiated within this scheme.
|
||||||
|
map<perm_string,PTask*> tasks;
|
||||||
|
map<perm_string,PFunction*>funcs;
|
||||||
|
|
||||||
// Generate schemes can contain further generate schemes.
|
// Generate schemes can contain further generate schemes.
|
||||||
list<PGenerate*> generate_schemes;
|
list<PGenerate*> generate_schemes;
|
||||||
PGenerate*parent;
|
PGenerate*parent;
|
||||||
|
|
|
||||||
100
elab_scope.cc
100
elab_scope.cc
|
|
@ -123,6 +123,64 @@ void Module::elaborate_parm_item_(perm_string name, const param_expr_t&cur,
|
||||||
delete val;
|
delete val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void elaborate_scope_tasks(Design*des, NetScope*scope,
|
||||||
|
const LineInfo&loc,
|
||||||
|
const map<perm_string,PTask*>&tasks)
|
||||||
|
{
|
||||||
|
typedef map<perm_string,PTask*>::const_iterator tasks_it_t;
|
||||||
|
|
||||||
|
for (tasks_it_t cur = tasks.begin()
|
||||||
|
; cur != tasks.end() ; cur ++ ) {
|
||||||
|
|
||||||
|
hname_t use_name( (*cur).first );
|
||||||
|
if (scope->child(use_name)) {
|
||||||
|
cerr << loc.get_fileline() << ": error: task/scope name "
|
||||||
|
<< use_name << " already used in this context."
|
||||||
|
<< endl;
|
||||||
|
des->errors += 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
NetScope*task_scope = new NetScope(scope, use_name,
|
||||||
|
NetScope::TASK);
|
||||||
|
task_scope->set_line((*cur).second);
|
||||||
|
|
||||||
|
if (debug_scopes)
|
||||||
|
cerr << cur->second->get_fileline() << ": debug: "
|
||||||
|
<< "Elaborate task scope " << scope_path(task_scope) << endl;
|
||||||
|
(*cur).second->elaborate_scope(des, task_scope);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void elaborate_scope_funcs(Design*des, NetScope*scope,
|
||||||
|
const LineInfo&loc,
|
||||||
|
const map<perm_string,PFunction*>&funcs)
|
||||||
|
{
|
||||||
|
typedef map<perm_string,PFunction*>::const_iterator funcs_it_t;
|
||||||
|
|
||||||
|
for (funcs_it_t cur = funcs.begin()
|
||||||
|
; cur != funcs.end() ; cur ++ ) {
|
||||||
|
|
||||||
|
hname_t use_name( (*cur).first );
|
||||||
|
if (scope->child(use_name)) {
|
||||||
|
cerr << loc.get_fileline() << ": error: function/scope name "
|
||||||
|
<< use_name << " already used in this context."
|
||||||
|
<< endl;
|
||||||
|
des->errors += 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
NetScope*func_scope = new NetScope(scope, use_name,
|
||||||
|
NetScope::FUNC);
|
||||||
|
func_scope->set_line((*cur).second);
|
||||||
|
|
||||||
|
if (debug_scopes)
|
||||||
|
cerr << cur->second->get_fileline() << ": debug: "
|
||||||
|
<< "Elaborate function scope " << scope_path(func_scope) << endl;
|
||||||
|
(*cur).second->elaborate_scope(des, func_scope);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
bool Module::elaborate_scope(Design*des, NetScope*scope,
|
bool Module::elaborate_scope(Design*des, NetScope*scope,
|
||||||
const replace_t&replacements) const
|
const replace_t&replacements) const
|
||||||
{
|
{
|
||||||
|
|
@ -266,49 +324,14 @@ bool Module::elaborate_scope(Design*des, NetScope*scope,
|
||||||
// elaborate_scope method of the PTask for detailed
|
// elaborate_scope method of the PTask for detailed
|
||||||
// processing.
|
// processing.
|
||||||
|
|
||||||
typedef map<perm_string,PTask*>::const_iterator tasks_it_t;
|
elaborate_scope_tasks(des, scope, *this, tasks);
|
||||||
|
|
||||||
for (tasks_it_t cur = tasks_.begin()
|
|
||||||
; cur != tasks_.end() ; cur ++ ) {
|
|
||||||
|
|
||||||
hname_t use_name( (*cur).first );
|
|
||||||
if (scope->child(use_name)) {
|
|
||||||
cerr << get_fileline() << ": error: task/scope name "
|
|
||||||
<< use_name << " already used in this context."
|
|
||||||
<< endl;
|
|
||||||
des->errors += 1;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
NetScope*task_scope = new NetScope(scope, use_name,
|
|
||||||
NetScope::TASK);
|
|
||||||
task_scope->set_line((*cur).second);
|
|
||||||
(*cur).second->elaborate_scope(des, task_scope);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Functions are very similar to tasks, at least from the
|
// Functions are very similar to tasks, at least from the
|
||||||
// perspective of scopes. So handle them exactly the same
|
// perspective of scopes. So handle them exactly the same
|
||||||
// way.
|
// way.
|
||||||
|
|
||||||
typedef map<perm_string,PFunction*>::const_iterator funcs_it_t;
|
elaborate_scope_funcs(des, scope, *this, funcs);
|
||||||
|
|
||||||
for (funcs_it_t cur = funcs_.begin()
|
|
||||||
; cur != funcs_.end() ; cur ++ ) {
|
|
||||||
|
|
||||||
hname_t use_name( (*cur).first );
|
|
||||||
if (scope->child(use_name)) {
|
|
||||||
cerr << get_fileline() << ": error: function/scope name "
|
|
||||||
<< use_name << " already used in this context."
|
|
||||||
<< endl;
|
|
||||||
des->errors += 1;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
NetScope*func_scope = new NetScope(scope, use_name,
|
|
||||||
NetScope::FUNC);
|
|
||||||
func_scope->set_line((*cur).second);
|
|
||||||
(*cur).second->elaborate_scope(des, func_scope);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Gates include modules, which might introduce new scopes, so
|
// Gates include modules, which might introduce new scopes, so
|
||||||
// scan all of them to create those scopes.
|
// scan all of them to create those scopes.
|
||||||
|
|
@ -610,6 +633,9 @@ void PGenerate::elaborate_subscope_(Design*des, NetScope*scope)
|
||||||
(*cur) -> generate_scope(des, scope);
|
(*cur) -> generate_scope(des, scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
elaborate_scope_tasks(des, scope, *this, tasks);
|
||||||
|
elaborate_scope_funcs(des, scope, *this, funcs);
|
||||||
|
|
||||||
// Scan the generated scope for gates that may create
|
// Scan the generated scope for gates that may create
|
||||||
// their own scopes.
|
// their own scopes.
|
||||||
typedef list<PGate*>::const_iterator pgate_list_it_t;
|
typedef list<PGate*>::const_iterator pgate_list_it_t;
|
||||||
|
|
|
||||||
69
elab_sig.cc
69
elab_sig.cc
|
|
@ -108,6 +108,42 @@ bool PScope::elaborate_sig_wires_(Design*des, NetScope*scope) const
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void elaborate_sig_funcs(Design*des, NetScope*scope,
|
||||||
|
const map<perm_string,PFunction*>&funcs)
|
||||||
|
{
|
||||||
|
typedef map<perm_string,PFunction*>::const_iterator mfunc_it_t;
|
||||||
|
|
||||||
|
for (mfunc_it_t cur = funcs.begin()
|
||||||
|
; cur != funcs.end() ; cur ++) {
|
||||||
|
|
||||||
|
hname_t use_name ( (*cur).first );
|
||||||
|
NetScope*fscope = scope->child(use_name);
|
||||||
|
if (scope == 0) {
|
||||||
|
cerr << (*cur).second->get_fileline() << ": internal error: "
|
||||||
|
<< "Child scope for function " << (*cur).first
|
||||||
|
<< " missing in " << scope_path(scope) << "." << endl;
|
||||||
|
des->errors += 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
(*cur).second->elaborate_sig(des, fscope);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void elaborate_sig_tasks(Design*des, NetScope*scope,
|
||||||
|
const map<perm_string,PTask*>&tasks)
|
||||||
|
{
|
||||||
|
typedef map<perm_string,PTask*>::const_iterator mtask_it_t;
|
||||||
|
|
||||||
|
for (mtask_it_t cur = tasks.begin()
|
||||||
|
; cur != tasks.end() ; cur ++) {
|
||||||
|
NetScope*tscope = scope->child( hname_t((*cur).first) );
|
||||||
|
assert(tscope);
|
||||||
|
(*cur).second->elaborate_sig(des, tscope);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Module::elaborate_sig(Design*des, NetScope*scope) const
|
bool Module::elaborate_sig(Design*des, NetScope*scope) const
|
||||||
{
|
{
|
||||||
bool flag = true;
|
bool flag = true;
|
||||||
|
|
@ -182,38 +218,12 @@ bool Module::elaborate_sig(Design*des, NetScope*scope) const
|
||||||
flag &= (*gt)->elaborate_sig(des, scope);
|
flag &= (*gt)->elaborate_sig(des, scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef map<perm_string,PFunction*>::const_iterator mfunc_it_t;
|
|
||||||
|
|
||||||
for (mfunc_it_t cur = funcs_.begin()
|
|
||||||
; cur != funcs_.end() ; cur ++) {
|
|
||||||
|
|
||||||
hname_t use_name ( (*cur).first );
|
|
||||||
NetScope*fscope = scope->child(use_name);
|
|
||||||
if (scope == 0) {
|
|
||||||
cerr << (*cur).second->get_fileline() << ": internal error: "
|
|
||||||
<< "Child scope for function " << (*cur).first
|
|
||||||
<< " missing in " << scope_path(scope) << "." << endl;
|
|
||||||
des->errors += 1;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
(*cur).second->elaborate_sig(des, fscope);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// After all the wires are elaborated, we are free to
|
// After all the wires are elaborated, we are free to
|
||||||
// elaborate the ports of the tasks defined within this
|
// elaborate the ports of the tasks defined within this
|
||||||
// module. Run through them now.
|
// module. Run through them now.
|
||||||
|
|
||||||
typedef map<perm_string,PTask*>::const_iterator mtask_it_t;
|
elaborate_sig_funcs(des, scope, funcs);
|
||||||
|
elaborate_sig_tasks(des, scope, tasks);
|
||||||
for (mtask_it_t cur = tasks_.begin()
|
|
||||||
; cur != tasks_.end() ; cur ++) {
|
|
||||||
NetScope*tscope = scope->child( hname_t((*cur).first) );
|
|
||||||
assert(tscope);
|
|
||||||
(*cur).second->elaborate_sig(des, tscope);
|
|
||||||
}
|
|
||||||
|
|
||||||
// initial and always blocks may contain begin-end and
|
// initial and always blocks may contain begin-end and
|
||||||
// fork-join blocks that can introduce scopes. Therefore, I
|
// fork-join blocks that can introduce scopes. Therefore, I
|
||||||
|
|
@ -461,6 +471,9 @@ bool PGenerate::elaborate_sig_(Design*des, NetScope*scope) const
|
||||||
cur->elaborate_sig(des, scope);
|
cur->elaborate_sig(des, scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
elaborate_sig_funcs(des, scope, funcs);
|
||||||
|
elaborate_sig_tasks(des, scope, tasks);
|
||||||
|
|
||||||
typedef list<PGenerate*>::const_iterator generate_it_t;
|
typedef list<PGenerate*>::const_iterator generate_it_t;
|
||||||
for (generate_it_t cur = generate_schemes.begin()
|
for (generate_it_t cur = generate_schemes.begin()
|
||||||
; cur != generate_schemes.end() ; cur ++ ) {
|
; cur != generate_schemes.end() ; cur ++ ) {
|
||||||
|
|
|
||||||
51
elaborate.cc
51
elaborate.cc
|
|
@ -3556,6 +3556,34 @@ void PSpecPath::elaborate(Design*des, NetScope*scope) const
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void elaborate_functions(Design*des, NetScope*scope,
|
||||||
|
const map<perm_string,PFunction*>&funcs)
|
||||||
|
{
|
||||||
|
typedef map<perm_string,PFunction*>::const_iterator mfunc_it_t;
|
||||||
|
for (mfunc_it_t cur = funcs.begin()
|
||||||
|
; cur != funcs.end() ; cur ++) {
|
||||||
|
|
||||||
|
hname_t use_name ( (*cur).first );
|
||||||
|
NetScope*fscope = scope->child(use_name);
|
||||||
|
assert(fscope);
|
||||||
|
(*cur).second->elaborate(des, fscope);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void elaborate_tasks(Design*des, NetScope*scope,
|
||||||
|
const map<perm_string,PTask*>&tasks)
|
||||||
|
{
|
||||||
|
typedef map<perm_string,PTask*>::const_iterator mtask_it_t;
|
||||||
|
for (mtask_it_t cur = tasks.begin()
|
||||||
|
; cur != tasks.end() ; cur ++) {
|
||||||
|
|
||||||
|
hname_t use_name ( (*cur).first );
|
||||||
|
NetScope*tscope = scope->child(use_name);
|
||||||
|
assert(tscope);
|
||||||
|
(*cur).second->elaborate(des, tscope);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When a module is instantiated, it creates the scope then uses this
|
* When a module is instantiated, it creates the scope then uses this
|
||||||
* method to elaborate the contents of the module.
|
* method to elaborate the contents of the module.
|
||||||
|
|
@ -3615,28 +3643,12 @@ bool Module::elaborate(Design*des, NetScope*scope) const
|
||||||
}
|
}
|
||||||
|
|
||||||
// Elaborate functions.
|
// Elaborate functions.
|
||||||
typedef map<perm_string,PFunction*>::const_iterator mfunc_it_t;
|
elaborate_functions(des, scope, funcs);
|
||||||
for (mfunc_it_t cur = funcs_.begin()
|
|
||||||
; cur != funcs_.end() ; cur ++) {
|
|
||||||
|
|
||||||
hname_t use_name ( (*cur).first );
|
|
||||||
NetScope*fscope = scope->child(use_name);
|
|
||||||
assert(fscope);
|
|
||||||
(*cur).second->elaborate(des, fscope);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Elaborate the task definitions. This is done before the
|
// Elaborate the task definitions. This is done before the
|
||||||
// behaviors so that task calls may reference these, and after
|
// behaviors so that task calls may reference these, and after
|
||||||
// the signals so that the tasks can reference them.
|
// the signals so that the tasks can reference them.
|
||||||
typedef map<perm_string,PTask*>::const_iterator mtask_it_t;
|
elaborate_tasks(des, scope, tasks);
|
||||||
for (mtask_it_t cur = tasks_.begin()
|
|
||||||
; cur != tasks_.end() ; cur ++) {
|
|
||||||
|
|
||||||
hname_t use_name ( (*cur).first );
|
|
||||||
NetScope*tscope = scope->child(use_name);
|
|
||||||
assert(tscope);
|
|
||||||
(*cur).second->elaborate(des, tscope);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get all the gates of the module and elaborate them by
|
// Get all the gates of the module and elaborate them by
|
||||||
// connecting them to the signals. The gate may be simple or
|
// connecting them to the signals. The gate may be simple or
|
||||||
|
|
@ -3724,6 +3736,9 @@ bool PGenerate::elaborate(Design*des, NetScope*container) const
|
||||||
|
|
||||||
bool PGenerate::elaborate_(Design*des, NetScope*scope) const
|
bool PGenerate::elaborate_(Design*des, NetScope*scope) const
|
||||||
{
|
{
|
||||||
|
elaborate_functions(des, scope, funcs);
|
||||||
|
elaborate_tasks(des, scope, tasks);
|
||||||
|
|
||||||
typedef list<PGate*>::const_iterator gates_it_t;
|
typedef list<PGate*>::const_iterator gates_it_t;
|
||||||
for (gates_it_t cur = gates.begin() ; cur != gates.end() ; cur ++ )
|
for (gates_it_t cur = gates.begin() ; cur != gates.end() ; cur ++ )
|
||||||
(*cur)->elaborate(des, scope);
|
(*cur)->elaborate(des, scope);
|
||||||
|
|
|
||||||
12
pform.cc
12
pform.cc
|
|
@ -102,7 +102,11 @@ PTask* pform_push_task_scope(char*name)
|
||||||
PTask*task = new PTask(task_name, pform_cur_module);
|
PTask*task = new PTask(task_name, pform_cur_module);
|
||||||
|
|
||||||
// Add the task to the current module
|
// Add the task to the current module
|
||||||
pform_cur_module->add_task(task->pscope_name(), task);
|
if (pform_cur_generate)
|
||||||
|
pform_cur_generate->tasks[task->pscope_name()] = task;
|
||||||
|
else
|
||||||
|
pform_cur_module->tasks[task->pscope_name()] = task;
|
||||||
|
|
||||||
// Make this the current lexical scope
|
// Make this the current lexical scope
|
||||||
lexical_scope = task;
|
lexical_scope = task;
|
||||||
return task;
|
return task;
|
||||||
|
|
@ -114,7 +118,11 @@ PFunction* pform_push_function_scope(char*name)
|
||||||
PFunction*func = new PFunction(func_name, lexical_scope);
|
PFunction*func = new PFunction(func_name, lexical_scope);
|
||||||
|
|
||||||
// Add the task to the current module
|
// Add the task to the current module
|
||||||
pform_cur_module->add_function(func->pscope_name(), func);
|
if (pform_cur_generate)
|
||||||
|
pform_cur_generate->funcs[func->pscope_name()] = func;
|
||||||
|
else
|
||||||
|
pform_cur_module->funcs[func->pscope_name()] = func;
|
||||||
|
|
||||||
// Make this the current lexical scope
|
// Make this the current lexical scope
|
||||||
lexical_scope = func;
|
lexical_scope = func;
|
||||||
return func;
|
return func;
|
||||||
|
|
|
||||||
|
|
@ -1089,8 +1089,8 @@ void Module::dump(ostream&out) const
|
||||||
|
|
||||||
// Dump the task definitions.
|
// Dump the task definitions.
|
||||||
typedef map<perm_string,PTask*>::const_iterator task_iter_t;
|
typedef map<perm_string,PTask*>::const_iterator task_iter_t;
|
||||||
for (task_iter_t cur = tasks_.begin()
|
for (task_iter_t cur = tasks.begin()
|
||||||
; cur != tasks_.end() ; cur ++) {
|
; cur != tasks.end() ; cur ++) {
|
||||||
out << " task " << (*cur).first << ";" << endl;
|
out << " task " << (*cur).first << ";" << endl;
|
||||||
(*cur).second->dump(out, 6);
|
(*cur).second->dump(out, 6);
|
||||||
out << " endtask;" << endl;
|
out << " endtask;" << endl;
|
||||||
|
|
@ -1098,8 +1098,8 @@ void Module::dump(ostream&out) const
|
||||||
|
|
||||||
// Dump the function definitions.
|
// Dump the function definitions.
|
||||||
typedef map<perm_string,PFunction*>::const_iterator func_iter_t;
|
typedef map<perm_string,PFunction*>::const_iterator func_iter_t;
|
||||||
for (func_iter_t cur = funcs_.begin()
|
for (func_iter_t cur = funcs.begin()
|
||||||
; cur != funcs_.end() ; cur ++) {
|
; cur != funcs.end() ; cur ++) {
|
||||||
out << " function " << (*cur).first << ";" << endl;
|
out << " function " << (*cur).first << ";" << endl;
|
||||||
(*cur).second->dump(out, 6);
|
(*cur).second->dump(out, 6);
|
||||||
out << " endfunction;" << endl;
|
out << " endfunction;" << endl;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue