Subversion Repositories pentevo

Rev

Rev 418 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed | ?url?

  1. // ROM loader
  2. //
  3.  
  4. module bin2v
  5. (
  6.         input  wire [18:0] in_addr,
  7.  
  8.         output reg  [ 7:0] out_word
  9. );
  10.  
  11.         integer fd;
  12.  
  13.  
  14.         reg [7:0] mem [0:524287];
  15.  
  16.  
  17.  
  18.         // load file
  19.         initial
  20.         begin
  21.                 fd = $fopen("zxevo.rom","rb");
  22.  
  23.                 if( 524288!=$fread(mem,fd) )
  24.                 begin
  25.                         $display("Couldn't load zxevo ROM!\n");
  26.                         $stop;
  27.                 end
  28.  
  29.                 $fclose(fd);
  30.         end
  31.  
  32.  
  33.  
  34.         always @*
  35.                 out_word = mem[in_addr];
  36.  
  37.  
  38. endmodule
  39.  
  40.