[sv-ec] mailbox - unblocking order

From: Daniel Mlynek <daniel.mlynek_at_.....>
Date: Wed May 21 2008 - 00:26:22 PDT
I cannot figure out how processes blocked by get mailbox function should be
unblocked. Is it tool dependend, random or LRM some how defines for such
cases should work.
1st should processes be unblocked in the order of blocking, or in fifo
order? (I'm not asking bout messages - messages should be strored in FIFO) -
the case is whe more thatn one process are blocked by get on the same
mailbox
2nd when the processes should unblock - exactly at the moment when message
is putted into mailbox - i below case it means that after m.put(1) process
unblocking_oric should be interrupted and process proc1  should be unblocked
and finished and so on.  The other possibility is to unblock processes
proc1, proc2, proc3 after unblocking_proc in suspended or iin this case
finished.
 
 
module top;
    mailbox #(integer) m=new;
    integer i;
        integer file;
    
 
    initial begin :proc1
        #1
        m.get(i);
        $fdisplay(file,"#1 %d %d", i, m.num());
    end
 
    initial begin :proc2
        #2;
        m.get(i);
        $fdisplay(file,"#2 %d %d", i, m.num());
    end
 
 initial begin :proc3
        #3;
        m.get(i);
        $fdisplay(file,"#3 %d %d", i, m.num());
    end
 
    initial begin :ublocking_proc
        #5;
        file= $fopen("results.txt");
        m.put(1);
        $fdisplay(file,"put(1)");
        m.put(2);
        $fdisplay(file,"put(2)");
        m.put(3);
        $fdisplay(file,"put(3)");
          if (m.try_get(i))
               $fdisplay(file,"#4 try %d %d", i, m.num());
    end
 
endmodule
 
 
DANiel
 

 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed May 21 00:27:08 2008

This archive was generated by hypermail 2.1.8 : Wed May 21 2008 - 00:28:10 PDT