lm32_ram.v

changeset 2
a61bb364ae1f
parent 0
cd0b58aa6f83
     1.1 --- a/lm32_ram.v	Sun Apr 04 20:42:58 2010 +0100
     1.2 +++ b/lm32_ram.v	Sun Apr 04 20:52:32 2010 +0100
     1.3 @@ -58,10 +58,12 @@
     1.4      ----------------------------------------------------------------------*/
     1.5     parameter data_width = 1;               // Width of the data ports
     1.6     parameter address_width = 1;            // Width of the address ports
     1.7 +`ifdef PLATFORM_LATTICE
     1.8     parameter RAM_IMPLEMENTATION = "AUTO";  // Implement memory in EBRs, else
     1.9                                             // let synthesis tool select best 
    1.10                                             // possible solution (EBR or LUT)
    1.11     parameter RAM_TYPE = "RAM_DP";          // Type of EBR to be used
    1.12 +`endif
    1.13     
    1.14     /*----------------------------------------------------------------------
    1.15      Inputs
    1.16 @@ -82,7 +84,8 @@
    1.17      ----------------------------------------------------------------------*/
    1.18     output [data_width-1:0] read_data;      // Data read from specified addess
    1.19     wire   [data_width-1:0] read_data;
    1.20 -   
    1.21 +
    1.22 +`ifdef PLATFORM_LATTICE
    1.23     generate
    1.24        
    1.25        if ( RAM_IMPLEMENTATION == "EBR" )
    1.26 @@ -257,6 +260,7 @@
    1.27        
    1.28  	else 
    1.29  	  begin
    1.30 +`endif
    1.31  	     /*----------------------------------------------------------------------
    1.32  	      Internal nets and registers
    1.33  	      ----------------------------------------------------------------------*/
    1.34 @@ -282,8 +286,9 @@
    1.35  	       if (enable_read)
    1.36  		 ra <= read_address;
    1.37  	     
    1.38 +`ifdef PLATFORM_LATTICE
    1.39  	  end
    1.40  
    1.41     endgenerate
    1.42 -
    1.43 +`endif
    1.44  endmodule