lm32_addsub.v

changeset 2
a61bb364ae1f
parent 0
cd0b58aa6f83
     1.1 diff -r ae6035050124 -r a61bb364ae1f lm32_addsub.v
     1.2 --- a/lm32_addsub.v	Sun Apr 04 20:42:58 2010 +0100
     1.3 +++ b/lm32_addsub.v	Sun Apr 04 20:52:32 2010 +0100
     1.4 @@ -64,13 +64,17 @@
     1.5  // Instantiations
     1.6  ///////////////////////////////////////////////////// 
     1.7  
     1.8 +// Only use Lattice specific constructs when compiling with ispLEVER
     1.9 +`ifdef PLATFORM_LATTICE
    1.10         generate
    1.11  	  if (`LATTICE_FAMILY == "SC" || `LATTICE_FAMILY == "SCM") begin
    1.12 +`endif
    1.13  	     wire [32:0] tmp_addResult = DataA + DataB + Cin;
    1.14  	     wire [32:0] tmp_subResult = DataA - DataB - !Cin;   
    1.15     
    1.16  	     assign  Result = (Add_Sub == 1) ? tmp_addResult[31:0] : tmp_subResult[31:0];
    1.17  	     assign  Cout = (Add_Sub == 1) ? tmp_addResult[32] : !tmp_subResult[32];
    1.18 +`ifdef PLATFORM_LATTICE
    1.19  	  end else begin
    1.20  	    pmi_addsub #(// ----- Parameters -------
    1.21  			 .pmi_data_width     (32),
    1.22 @@ -89,5 +93,6 @@
    1.23  			 .Overflow           ());
    1.24  	  end
    1.25         endgenerate 
    1.26 +`endif
    1.27  
    1.28  endmodule