Commits

Pjotr Kourzanov committed 9f5a51f

tryout

Comments (0)

Files changed (3)

dom/Pthread/lib/Pthread-shell.awk

 	{
 	    p=stateports[f,sn,"read",j]
 	    c=init_node[f,sn,p]
+	    if (!nnodes[c]) print space(2) "{",node_code[f,c,"iterative"],"}"
 	    for (k=1; k<=nnodes[c]; k++) {
 		n=nodes[c,k]
 	    	args=""
 	    isp=init_port[f,sn,p]
 	    print space(4) get_portdef(f,isn,isp) ";"
 	    c=peer_node[f,sn,p]
+	    if (!nnodes[c]) print space(2) "{",node_code[f,c,"iterative"],"}"
 	    for (k=1; k<=nnodes[isn]; k++) {
 		n=nodes[isn,k]
 	    	args=""
 	{
 	    p=stateports[f,sn,"write",j]
 	    c=deinit_node[f,sn,p]
+	    if (!nnodes[c]) print space(2) "{",node_code[f,c,"iterative"],"}"
 	    for (k=1; k<=nnodes[c]; k++) {
 		n=nodes[c,k]
 	    	args=""
     	        !is_sizeport(c,peer_node[c,n,p],fp))
 	    {
 	    	pv=dump_portvar(f,c,n,p)
-		printf space(2) "assert(%s_state==%s_%s_BUSY);\n",pv,c,fp
+		printf space(2) "assert(%s_state==%s_%s_BUSY);\n",pv,f==c ? n : c,fp
 		printf space(2) "assert(%s);\n",pv
 		acquired[p]=1
 	    }

lib/gen-shell.awk

 }
 # fold port name to the incoming port name
 func fold_portvar(f,c,n,p) {
+
     if (peer_port[c,n,p])
     	return (is_inport(c,n,p) ? p : peer_port[c,n,p])
 
     if (deinit_port[f,c,p])
     	return (is_inport(f,c,p) ? p : deinit_port[f,c,p])
 
+    #if (f==c) c=n
+
 }
 
 func dump_portvar(f,c,n,p,pr,sf, fp) {
 }
 
 func is_virtual(f,c,n,p) {
+        #if (f==c) c=n
 	if ((f,c,p) in delayport_idx) return 1
 	if ((f,c,p) in rushport_idx) return 1
 	if ((f,c,p) in stateport_idx) return 1
 }
 
 func is_state(f,c,n,p) {
+        #if (f==c) c=n
 	if ((f,c,p) in stateport_idx) return 1
 	return 0
 }
 
 func is_fifo(f,c,n,p) {
+        #if (f==c) c=n
 	if ((f,c,p) in fifo_idx) return 1
 	if ((c,n,p) in fifo_idx) return 1
 	return 0
 	if (!no_dump_ports) dump_ports(f,c)
 	print space(2) "// ACQUIRES"
 	do_acquires(f,f,c)
-	print space(2) "// DOWNCALL"
+	print space(2) "// FUNCTIONALITY"
 if (do_watch)	print space(2) "startw(args->watch[1]);"
 	if (node_code[f,c,"iterative"]) print "{", node_code[f,c,"iterative"],"}"
 if (do_watch)	print space(2) "stopw(args->watch[1]);"
 		if (node_ret[c,n] ~ /subactor/) printf space(2) "if (ret==%s)\n",scpe(c,n)
 	}
 
-
 	for (j=1; j<=nports[c,n]; j++) {
 		p=ports[c,n,j]
 		pv=dump_portvar(f,c,n,p)

lib/xml-parser.awk

 ##################################################################
 BEGIN { state="" }
 
-
 !NOTRACKFILES { files[f=(FILENAME=="-" ? "stdin" : FILENAME)]=1 }
 
 { for (unh=1; $0 && unh<=1; )