commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r6514 - gnuradio/branches/developers/matt/u2f/models


From: matt
Subject: [Commit-gnuradio] r6514 - gnuradio/branches/developers/matt/u2f/models
Date: Sun, 23 Sep 2007 19:23:20 -0600 (MDT)

Author: matt
Date: 2007-09-23 19:23:20 -0600 (Sun, 23 Sep 2007)
New Revision: 6514

Modified:
   gnuradio/branches/developers/matt/u2f/models/cpld_model.v
Log:
can read from a file specified on the command line, using +rom=<filename>


Modified: gnuradio/branches/developers/matt/u2f/models/cpld_model.v
===================================================================
--- gnuradio/branches/developers/matt/u2f/models/cpld_model.v   2007-09-24 
00:57:25 UTC (rev 6513)
+++ gnuradio/branches/developers/matt/u2f/models/cpld_model.v   2007-09-24 
01:23:20 UTC (rev 6514)
@@ -19,12 +19,22 @@
    localparam DETACHED = 3'd5;
    localparam ERROR = 3'd7;
    
-   integer i;   
+   integer i; 
+   reg [1023:0] ROMFile;
+   
    initial begin
       for (i=0;i<65536;i=i+1) begin
         rom[i] <= 32'h0;
-      end      
-      #1 $readmemh("flash.rom",rom);
+      end       
+      if ( !$value$plusargs( "rom=%s", ROMFile ) )
+        begin
+           $display( "Using default ROM file, 'flash.rom'" );
+           ROMFile = "flash.rom";
+        end
+      else
+       $display( "Using %s as ROM file.", ROMFile);
+      
+      #1 $readmemh( ROMFile,rom );     
    end
 
    initial addr = 16'd0;
@@ -42,9 +52,6 @@
           else
             state <= ERROR;
        READ :
-        //      if(start)
-         // state <= ERROR;
-        //else 
         if(done)
           state <= DONE;
                 else





reply via email to

[Prev in Thread] Current Thread [Next in Thread]