File: smrd04.v

package info (click to toggle)
gplcver 2.12a-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,604 kB
  • ctags: 9,129
  • sloc: ansic: 126,201; sh: 1,539; makefile: 86; perl: 22
file content (22 lines) | stat: -rw-r--r-- 634 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module top;
 parameter idprom_width = 10, idprom_depth = 2, step = 20;
 reg [8*idprom_width:1] s1, s2;
 integer index;

 reg [idprom_width:1] idprom[1:idprom_depth];

 initial
  begin
   // probably should do some checking here
   if ($scan$plusargs("idprom1=", s1) == 0
    || $scan$plusargs("idprom2=", s2) == 0) 
    begin
     $display("missing or bad idprom option(s)"); 
     $finish;
    end
   $sreadmemb(idprom,,, s1, s2);
   for (index = 0; index < idprom_depth; index = index + 1) #step;
   for (index = 1; index <= idprom_depth; index = index + 1)   
    $display("idprom[%0d]=%b", index, idprom[index]); 
  end
endmodule