Merge branch 'master' of github.com:steveicarus/iverilog
This commit is contained in:
commit
483d0534ae
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1999-2008,2010 Stephen Williams (steve@icarus.com)
|
* Copyright (c) 1999-2013 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
|
||||||
|
|
@ -74,7 +74,7 @@ PChainConstructor* PFunction::extract_chain_constructor()
|
||||||
{
|
{
|
||||||
PChainConstructor*res = 0;
|
PChainConstructor*res = 0;
|
||||||
|
|
||||||
if (res = dynamic_cast<PChainConstructor*> (statement_)) {
|
if ((res = dynamic_cast<PChainConstructor*> (statement_))) {
|
||||||
statement_ = 0;
|
statement_ = 0;
|
||||||
|
|
||||||
} else if (PBlock*blk = dynamic_cast<PBlock*>(statement_)) {
|
} else if (PBlock*blk = dynamic_cast<PBlock*>(statement_)) {
|
||||||
|
|
|
||||||
|
|
@ -2145,10 +2145,11 @@ unsigned PECallFunction::elaborate_arguments_(Design*des, NetScope*scope,
|
||||||
unsigned missing_parms = 0;
|
unsigned missing_parms = 0;
|
||||||
|
|
||||||
const unsigned parm_count = parms.size() - parm_off;
|
const unsigned parm_count = parms.size() - parm_off;
|
||||||
|
const unsigned actual_count = parms_.size();
|
||||||
|
|
||||||
for (unsigned idx = 0 ; idx < parm_count ; idx += 1) {
|
for (unsigned idx = 0 ; idx < parm_count ; idx += 1) {
|
||||||
unsigned pidx = idx + parm_off;
|
unsigned pidx = idx + parm_off;
|
||||||
PExpr*tmp = parms_[idx];
|
PExpr*tmp = (idx < actual_count) ? parms_[idx] : 0;
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
parms[pidx] = elaborate_rval_expr(des, scope,
|
parms[pidx] = elaborate_rval_expr(des, scope,
|
||||||
def->port(pidx)->net_type(),
|
def->port(pidx)->net_type(),
|
||||||
|
|
|
||||||
|
|
@ -601,16 +601,28 @@ void vthreads_delete(struct __vpiScope*scope)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reaping pulls the thread out of the stack of threads. If I have a
|
* Reaping pulls the thread out of the stack of threads. If I have a
|
||||||
* child, then hand it over to my parent.
|
* child, then hand it over to my parent or fully detach it.
|
||||||
*/
|
*/
|
||||||
static void vthread_reap(vthread_t thr)
|
static void vthread_reap(vthread_t thr)
|
||||||
{
|
{
|
||||||
if (! thr->children.empty()) {
|
if (! thr->children.empty()) {
|
||||||
for (set<vthread_t>::iterator cur = thr->children.begin()
|
for (set<vthread_t>::iterator cur = thr->children.begin()
|
||||||
; cur != thr->children.end() ; ++cur) {
|
; cur != thr->children.end() ; ++cur) {
|
||||||
vthread_t curp = *cur;
|
vthread_t child = *cur;
|
||||||
assert(curp->parent == thr);
|
assert(child);
|
||||||
curp->parent = thr->parent;
|
assert(child->parent == thr);
|
||||||
|
child->parent = thr->parent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! thr->detached_children.empty()) {
|
||||||
|
for (set<vthread_t>::iterator cur = thr->detached_children.begin()
|
||||||
|
; cur != thr->detached_children.end() ; ++cur) {
|
||||||
|
vthread_t child = *cur;
|
||||||
|
assert(child);
|
||||||
|
assert(child->parent == thr);
|
||||||
|
assert(child->i_am_detached);
|
||||||
|
child->parent = 0;
|
||||||
|
child->i_am_detached = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (thr->parent) {
|
if (thr->parent) {
|
||||||
|
|
@ -2224,11 +2236,6 @@ bool of_DISABLE(vthread_t thr, vvp_code_t cp)
|
||||||
while (! scope->threads.empty()) {
|
while (! scope->threads.empty()) {
|
||||||
set<vthread_t>::iterator cur = scope->threads.begin();
|
set<vthread_t>::iterator cur = scope->threads.begin();
|
||||||
|
|
||||||
/* If I am disabling myself, then remember that fact so
|
|
||||||
that I can finish this statement differently. */
|
|
||||||
if (*cur == thr)
|
|
||||||
disabled_myself_flag = true;
|
|
||||||
|
|
||||||
if (do_disable(*cur, thr))
|
if (do_disable(*cur, thr))
|
||||||
disabled_myself_flag = true;
|
disabled_myself_flag = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue