mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	Modify DW02_multp to properly list the correct number of bits at the output (i.e., 2*WIDTH + 2).
This commit is contained in:
		
							parent
							
								
									8d08ca6a1e
								
							
						
					
					
						commit
						b65a4bd040
					
				@ -29,9 +29,16 @@ module redundantmul #(parameter WIDTH =8)(
 | 
			
		||||
  input logic [WIDTH-1:0]    a,b,
 | 
			
		||||
  output logic [2*WIDTH-1:0] out0, out1);
 | 
			
		||||
 | 
			
		||||
   logic [2*WIDTH-1+2:0]     tmp_out0;
 | 
			
		||||
   logic [2*WIDTH-1+2:0]     tmp_out1;   
 | 
			
		||||
 | 
			
		||||
   generate
 | 
			
		||||
      if (`DESIGN_COMPILER == 1)
 | 
			
		||||
       DW02_multp #(WIDTH, WIDTH, 2*WIDTH) mul(.a, .b, .tc(1'b0), .out0, .out1);
 | 
			
		||||
	begin
 | 
			
		||||
	   DW02_multp #(WIDTH, WIDTH, 2*WIDTH+2) mul(.a, .b, .tc(1'b0), .out0(tmp_out0), .out1(tmp_out1));
 | 
			
		||||
	   assign out0 = tmp_out0[2*WIDTH-1:0];
 | 
			
		||||
	   assign out1 = tmp_out1[2*WIDTH-1:0];
 | 
			
		||||
	end
 | 
			
		||||
      else if (`DESIGN_COMPILER == 2)
 | 
			
		||||
	mult_cs #(WIDTH) mul(.a, .b, .tc(1'b0), .sum(out0), .carry(out1));
 | 
			
		||||
      else begin // force a nonredunant multipler.  This will simulate properly and also is appropriate for FPGAs.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user