Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
modify syntax for writing codes to more like functional calls, and co…
Browse files Browse the repository at this point in the history
…nvert wait bitfield to integer list
  • Loading branch information
hughperkins committed May 23, 2016
1 parent 25f229c commit d1bf13b
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions lib/MaxAs/MaxAsGrammar.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1354,27 +1354,30 @@ sub printCtrl
$watdb = $watdb ? sprintf('%02x', $watdb) : '--';

my @codes;
if($watdb ne '--') {
# $res += "waitdep="
push @codes, "waitbarrier=$watdb";
if($readb ne '-') {
push @codes, "setReadBarrier($readb)";
}
if($wrtdb ne '-') {
# $res += "waitdep="
push @codes, "writebarrier=$wrtdb";
push @codes, "setWriteBarrier($wrtdb)";
}
if($readb ne '-') {
# $res += "waitdep="
push @codes, "readbarrier=$readb";
if($watdb ne '--') {
my @barriers;
for(my $barrier=1; $barrier <= 6; $barrier++) {
my $bitvalue = 1 << ($barrier - 1);
if($watdb & $bitvalue) {
push @barriers, $barrier;
}
}
my $barrierstring = sprintf "waitBarriers([%s])", join(",", @barriers);
push @codes, $barrierstring;
}
if($yield ne '-') {
# $res += "waitdep="
push @codes, "yield";
push @codes, "yield()";
}
if($stall > 0) {
# $res += "waitdep="
push @codes, "stall=$stall";
push @codes, "stall($stall)";
}
my $res = join(",", @codes);
my $res = join(";", @codes);
if($res ne "") {
$res = join("", "# ", $res, "\n");
}
Expand Down

0 comments on commit d1bf13b

Please sign in to comment.