Skip to content

Commit

Permalink
whitespace and indentation fixes
Browse files Browse the repository at this point in the history
Replace tabstops, correct indentation according to Lattice's coding style.
This huge patch makes it harder to backport upstream fixes, but there was
already a patch which replaced almost every line in the source code. So it
was already hard :)

Signed-off-by: Michael Walle <michael@walle.cc>
  • Loading branch information
mwalle committed Dec 16, 2012
1 parent a2ed7df commit 98dc41d
Show file tree
Hide file tree
Showing 19 changed files with 1,227 additions and 1,229 deletions.
26 changes: 13 additions & 13 deletions rtl/lm32_adder.v
Expand Up @@ -2,7 +2,7 @@
// >>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<
// ------------------------------------------------------------------
// Copyright (c) 2006-2011 by Lattice Semiconductor Corporation
// ALL RIGHTS RESERVED
// ALL RIGHTS RESERVED
// ------------------------------------------------------------------
//
// IMPORTANT: THIS FILE IS AUTO-GENERATED BY THE LATTICEMICO SYSTEM.
Expand All @@ -11,7 +11,7 @@
//
// Lattice Semiconductor grants permission to use this code
// pursuant to the terms of the Lattice Semiconductor Corporation
// Open Source License Agreement.
// Open Source License Agreement.
//
// Disclaimer:
//
Expand All @@ -37,7 +37,7 @@
// FILE DETAILS
// Project : LatticeMico32
// File : lm32_adder.v
// Title : Integer adder / subtractor with comparison flag generation
// Title : Integer adder / subtractor with comparison flag generation
// Dependencies : lm32_include.v
// Version : 6.1.17
// : Initial Release
Expand Down Expand Up @@ -84,27 +84,27 @@ output adder_carry_n_x; // Inverted carry
wire adder_carry_n_x;
output adder_overflow_x; // Indicates if overflow occured, only valid for subtractions
reg adder_overflow_x;

/////////////////////////////////////////////////////
// Internal nets and registers
// Internal nets and registers
/////////////////////////////////////////////////////

wire a_sign; // Sign (i.e. positive or negative) of operand 0
wire b_sign; // Sign of operand 1
wire result_sign; // Sign of result

/////////////////////////////////////////////////////
// Instantiations
// Instantiations
/////////////////////////////////////////////////////

lm32_addsub addsub (
// ----- Inputs -----
.DataA (operand_0_x),
.DataB (operand_1_x),
.Cin (adder_op_x),
.Add_Sub (adder_op_x_n),
.DataA (operand_0_x),
.DataB (operand_1_x),
.Cin (adder_op_x),
.Add_Sub (adder_op_x_n),
// ----- Ouputs -----
.Result (adder_result_x),
.Result (adder_result_x),
.Cout (adder_carry_n_x)
);

Expand All @@ -121,7 +121,7 @@ assign result_sign = adder_result_x[`LM32_WORD_WIDTH-1];
// Determine whether an overflow occured when performing a subtraction

always @(*)
begin
begin
// +ve - -ve = -ve -> overflow
// -ve - +ve = +ve -> overflow
if ( (!a_sign & b_sign & result_sign)
Expand All @@ -131,6 +131,6 @@ begin
else
adder_overflow_x = `FALSE;
end

endmodule

26 changes: 13 additions & 13 deletions rtl/lm32_addsub.v
Expand Up @@ -2,7 +2,7 @@
// >>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<
// ------------------------------------------------------------------
// Copyright (c) 2006-2011 by Lattice Semiconductor Corporation
// ALL RIGHTS RESERVED
// ALL RIGHTS RESERVED
// ------------------------------------------------------------------
//
// IMPORTANT: THIS FILE IS AUTO-GENERATED BY THE LATTICEMICO SYSTEM.
Expand All @@ -11,7 +11,7 @@
//
// Lattice Semiconductor grants permission to use this code
// pursuant to the terms of the Lattice Semiconductor Corporation
// Open Source License Agreement.
// Open Source License Agreement.
//
// Disclaimer:
//
Expand Down Expand Up @@ -54,12 +54,12 @@

module lm32_addsub (
// ----- Inputs -------
DataA,
DataB,
Cin,
Add_Sub,
DataA,
DataB,
Cin,
Add_Sub,
// ----- Outputs -------
Result,
Result,
Cout
);

Expand All @@ -83,13 +83,13 @@ wire Cout;

/////////////////////////////////////////////////////
// Instantiations
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////

// Modified for Milkymist: removed non-portable instantiated block
wire [32:0] tmp_addResult = DataA + DataB + Cin;
wire [32:0] tmp_subResult = DataA - DataB - !Cin;
assign Result = (Add_Sub == 1) ? tmp_addResult[31:0] : tmp_subResult[31:0];
assign Cout = (Add_Sub == 1) ? tmp_addResult[32] : !tmp_subResult[32];
wire [32:0] tmp_addResult = DataA + DataB + Cin;
wire [32:0] tmp_subResult = DataA - DataB - !Cin;

assign Result = (Add_Sub == 1) ? tmp_addResult[31:0] : tmp_subResult[31:0];
assign Cout = (Add_Sub == 1) ? tmp_addResult[32] : !tmp_subResult[32];

endmodule

0 comments on commit 98dc41d

Please sign in to comment.