Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanohar committed Jul 17, 2023
1 parent 965b08d commit 7ffba6a
Show file tree
Hide file tree
Showing 7 changed files with 1,849 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chpsim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5946,7 +5946,7 @@ void ChpSim::_zeroAllIntsChans (ChpSimGraph *g)
}
else {
off = computeOffset (g->stmt->u.sendrecv.d);
if (g->stmt->u.sendrecv.d->isbool) {
if (g->stmt->u.sendrecv.d_type == 0) {
// nothing to do
}
else {
Expand Down
52 changes: 52 additions & 0 deletions test/inf4.act
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
defproc test1(chan?(bool) in; chan!(int<1>) out)
{
chp {
*[ [#in]; out!int(in);in? ]
}
}

defproc boolsrc(chan!(bool) X)
{
chp {
*[ X!true; X!false ]
}
}

defproc intsrc(chan!(int<1>) X)
{
chp {
*[ X!0; X!1 ]
}
}

defproc test2(chan?(int<1>) in; chan!(bool) out)
{
chp {
*[ [#in];out!bool(in);in? ]
}
}

defproc boolsink(chan?(bool) W)
{
bool x;

chp {
*[ W?x; log ("got bool: ", x) ]
}
}

defproc intsink(chan?(int<1>) W)
{
int<1> x;

chp {
*[ W?x; log ("got int: ", x) ]
}
}

defproc test()
{
boolsrc s;
test1 t(s.X);
intsink ix(t.out);
}
52 changes: 52 additions & 0 deletions test/inf5.act
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
defproc test1(chan?(bool) in; chan!(int<1>) out)
{
chp {
*[ [#in]; out!int(in);in? ]
}
}

defproc boolsrc(chan!(bool) X)
{
chp {
*[ X!true; X!false ]
}
}

defproc intsrc(chan!(int<1>) X)
{
chp {
*[ X!0; X!1 ]
}
}

defproc test2(chan?(int<1>) in; chan!(bool) out)
{
chp {
*[ [#in];out!bool(in);in? ]
}
}

defproc boolsink(chan?(bool) W)
{
bool x;

chp {
*[ W?x; log ("got bool: ", x) ]
}
}

defproc intsink(chan?(int<1>) W)
{
int<1> x;

chp {
*[ W?x; log ("got int: ", x) ]
}
}

defproc test()
{
intsrc s;
test2 t(s.X);
boolsink ix(t.out);
}
3 changes: 3 additions & 0 deletions test/runs/inf4.act.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
WARNING: intsink<>: substituting chp model (requested prs, not found)
WARNING: test1<>: substituting chp model (requested prs, not found)
WARNING: boolsrc<>: substituting chp model (requested prs, not found)
Loading

0 comments on commit 7ffba6a

Please sign in to comment.