/ C-1 HOME CONTENTS INDEX E-mail your comments about Synopsys documentation to [email protected]vV-2003.12 HDL Compiler (Presto Verilog) Reference Manual C Differences Between HDL Compiler (Presto Verilog) and the Original HDL Compiler C This appendix describes new features and the differences between HDL Compiler (Presto Verilog) and the original HDL Compiler, in the following sections: • Verilog 2001 Features • Other New Features and Enhancements • Features and Variables Not Supported • Deprecated Features • Changes From the Original HDL Compiler Tool • Implementation Differences • Public Variables for HDL Compiler (Presto Verilog)
74
Embed
HDL Compiler (Presto Verilog) RM: C. Differences Between HDL …read.pudn.com/downloads181/ebook/845528/preug/preug_c.pdf · Table C-1 lists the Verilog 2001 features implemented
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Table C-1 lists the Verilog 2001 features implemented by HDLCompiler (Presto Verilog). For additional information on thesefeatures, see IEEE Std 1364-2001. For information about other newfeatures and enhancements, see Table C-3 on page C-35.
Table C-1 Verilog 2001 Features
Feature Description
As of Version 2003.12
Constant function support Allows parameter and local parameter assignments thatcontain calls to constant functions.
Verilog 2001 constant functions are supported on theright-hand side of a parameter assignment, as shown below.
Local parameter support Presto Verilog fully supports the localparam construct.
As of Version 2003.09
No Verilog 2001 featureswere added.
As of Version 2003.06
No Verilog 2001 featureswere added.
As of Version 2003.03
Generate statement For description and example, see “generate Statements” onpage C-7.
translate_off andtranslate_on
The //synopsys translate_off directive and the //synopsystranslate_on directive are deprecated; their function isreplaced with the SYNTHESIS macro and the appropriateconditional directives (`ifdef, `ifndef, `else, `endif). For details,see “Deprecated Features” on page C-58.
SYNTHESIS macro To suspend translation of the source code for synthesis, PrestoVerilog supports the macro SYNTHESIS. For details, see“Standard Macros (SYNTHESIS, PRESTO, VERILOG_2001,and VERILOG_1995)” on page 7-6 and “DeprecatedFeatures” on page C-58.
Table C-1 Verilog 2001 Features (Continued)
Feature Description
/ C-3HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
Implicit net declarations forcontinuous assignments
If an identifier appears on the left-hand side of a continuousassignment statement, and that identifier has not beendeclared previously, then Presto assumes an implicit scalarnet declaration.
For example, the following two module declarations areequivalent:
module m1 (output out, input in);
wire t ;
assign t = in ;
assign out = t ;
endmodule
module m2 (output out, input in) ;
assign t = in ;
assign out = t ;
endmodule
Notice that the explicit wire declaration is no longer needed.
`line directive The `line directives are inserted by preprocessing tools topreserve information for other tools about the line numbersand file names of the original source files, so that diagnosticmessages can still refer to them.
As of Version 2002.05
Expanded ANSI-C-styleport declarations
See “Full ANSI Style Declaration Support” on page C-8.
As of Version 2001.08
Casting operators Allows sign control; preserves the value of the argument.Casting operators are $signed() and $unsigned(). See See“Controlling Signs With Casting Operators” on page C-19.
Table C-1 Verilog 2001 Features (Continued)
Feature Description
/ C-4HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
Allows setting parameters on subdesigns by parameter name;it is not sensitive to number or declaration order of parameters.You only need to specify the subset of parameters you want toset.
For example, assuming
module m1 (x, y);
parameter p = 7;
parameter q = 8;
parameter r = 9;
then
m1 #(.r(3), .p(1)) u1 (x, y)
is equivalent to
m1 #(1,8,3) u1 (x, y);
Implicit event expression list(IEEE 9.7.5)
Makes always blocks sensitive to any variable read.Syntax: (@*)The event expression does not need to list net and variableidentifiers; they are automatically added to the eventexpression. If you do not use this syntax and the tool finds anincomplete sensitivity list, the tool will issue a warning.
ANSI-C-style portdeclaration(IEEE 12.3.3)
You can list types when declaring port values—for example,module t (input [1:0] in, output [2:0] out). For additionalexamples, see “Full ANSI Style Declaration Support” onpage C-8.
As of Version 2000.11
Signed/unsignedparameters(IEEE 3.11)
See “Signed Quantities” on page C-14.
Table C-1 Verilog 2001 Features (Continued)
Feature Description
/ C-5HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
New array functionalityMultidimensional arrays(IEEE 3.10.3)Arrays of nets(IEEE 3.10)
See “New Array Functionality” on page C-11.
New operators See “New Operators” on page C-27.
Part select addressing ([+:]and [-:] operators)(IEEE 4.2.1)
See “New Operators” on page C-27.
Power operator (**)(IEEE 4.1.5)
See “New Operators” on page C-27.
Arithmetic shift operators(<<< and >>>)(IEEE 4.1.12)
See “New Operators” on page C-27.
Sized parameters(IEEE 3.11.1)
A bit range can be used when declaring parameters.
New compiler directives`ifndef, `elsif, `undef(IEEE 19.4,19.3.2)
See See “New Operators” on page C-27.
New compiler directives`ifdef VERILOG_2001 and`ifdef VERILOG_1995
See See “Standard Macros (SYNTHESIS, PRESTO,VERILOG_2001, and VERILOG_1995)” on page 7-6. Thedc_shell variable for enabling/disabling Verilog 2001 mode is:hdlin_vrlg_std.
Set hdlin_vrlg_std = 1995 to disable Verilog 2001features. Default is hdlin_vrlg_std = 2001, which enablesVerilog 2001 features.
Table C-1 Verilog 2001 Features (Continued)
Feature Description
/ C-6HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
The generate statement is an IEEE 1364-2001 Verilog construct thatmakes the language easier to use by simplifying the RTL codeneeded to repeat a group of concurrent statements or componentinstantiations.
In Example C-1, a generate loop is constructed around a flip-flop andexecuted three times making three flip-flops.
Example C-1 generate statementmodule gen (clk, din, dout); parameter N = 3; input clk; input [N-1:0] din; output [N-1:0] dout; reg [N-1:0] dout; genvar i; generate for (i = 0; i < N; i = i+1) begin : my_generate_loop always @ (posedge clk) dout[i] <= din[i]; end endgenerateendmodule
HDL Compiler (Presto Verilog) builds three sequential genericelements—SEQGENs—which, when compiled, are implemented asshown in Figure C-2.
Comma-separatedsensitivity lists(IEEE 4.1.15 and 9.7.4)
Signals in the sensitivity list can be separated with commas.
Table C-1 Verilog 2001 Features (Continued)
Feature Description
/ C-7HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
module m4 (input [7:0] a, output reg [7:0] b);defparam t.testb = 8, t.testa=1, t.WIDTH=1;test #(8) t (a, b);
endmodule
module test #(parameter WIDTH=4, testa=5, testb=6) ( input[WIDTH-1:0] in,output[WIDTH-1:0] out);// Instead of declaring parameters inside the body of themodule,// the ANSI style allows you to declare parameters this way.endmodule
module m5 (input signed [7:0]a, output signed [7:0]b);endmodule
module m6 (input signed a, output signed b); endmodule
module m7 (input wire signed [7:0]a, output wire signed[7:0]b);
/ C-9HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
HDL Compiler (Presto Verilog) supports multidimensional arrays ofany variable or net data type. This added functionality is shown inExamples C-3 through C-6.
/ C-11HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
HDL Compiler (Presto Verilog) supports signed arithmeticextensions. Function returns and data types reg and net can bedeclared as signed. This added functionality is shown inExamples C-7 through C-12.
Example C-7 Signed I/O Ports: Code and Circuit
// This results in a// sign-extension.
// (that is, z[0] should be// connected to a[0])
module m1 (a, z);
input signed [0:3] a;
output signed [0:4] z;
assign z = a;
endmodulea [0:3]
a [1] z [2]
a [0] z [0:1]
a [2] z [3]
a [3] z [4]
z [0:4]
/ C-14HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
Verilog 2001 adds the signed keyword in declarations:reg signed [7:0] x;
It also adds a new feature for signed, sized constants. For example,8'sb11111111 is an 8-bit signed quantity representing -1. If you areassigning it to a variable that is 8 bits or less, 8'sb11111111 is thesame as the unsigned 8'b11111111. A behavior difference ariseswhen the variable being assigned to is larger than the constant. Thisdifference occurs because signed quantities are extended with thehigh-order bit of the constant, whereas unsigned quantities areextended with 0's. When used in expressions, the sign of theconstant helps determine whether the operation is performed assigned or unsigned.
HDL Compiler (Presto Verilog) enables signed types by default; todisable signed types, set hdlin_unsigned_integers to true.
//Because 4’sd5 is signed, a//signed comparator (LT_TC_OP)//is used.
module m6 (a, z);
input [3:0] a;
output z;
reg signed [3:0] x;
wire z;
always @(a) begin
x = a;
end
assign z = x < -4’sd5;
endmodule
0123
0123
a[0]a[1]a[2]a[3]
z<+v
LT_TC_OP
/ C-17HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
Note:When synthesizing expressions containing variables declared asinteger, the original HDL Compiler did not consider the integertype to be a “hardware” data type and generated unsignedcomponents; HDL Compiler (Presto Verilog) synthesizes thesigned versions of arithmetic operators for expressions whosetype is integer. HDL Compiler (Presto Verilog) behavior conformsmore closely to the IEEE Standard.
Any designs that use the integer type for expressions that cannotbe completely evaluated at the time of elaboration may beaffected by this change. However, computations that are knownconstants at compile time are not affected (for example,calculation of for loop bounds). You should evaluate whether thischange will affect your design.
To obtain the original behavior, sethdlin_unsigned_integers to true. Note that if you use thekeyword signed, any signed constant in your code, or explicittype casting between signed and unsigned types, HDL Compiler(Presto Verilog) issues a warning and forceshdlin_unsigned_integers back to false.
Comparisons With Signed Types
Verilog sign rules are tricky. All inputs to an expression must besigned to obtain a signed operator. If one is signed and oneunsigned, then both are treated as unsigned. Any unsigned quantityin an expression makes the whole expression unsigned and theresult doesn’t depend on the sign of left-hand side. Someexpressions always produce an unsigned result; these include bitand part-select and concatenation. See IEEE P1364/P5 Section4.5.1.
/ C-18HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
You need to control the sign of the inputs yourself if you want tocompare a signed quantity against an unsigned one. The same istrue for other kinds of expressions. See Example C-14 andExample C-13.
Example C-13 Unsigned Comparison Results When Signs AreMismatched
module m8 (in1, in2, lt);// in1 is signed but in2 is unsigned input signed [7:0] in1; input [7:0] in2; output lt; wire uns_lt, uns_in1_lt_64;/* comparison is unsigned because of the sign mismatch, in1is signed but in2 is unsigned */ assign uns_lt = in1 < in2;/* Unsigned constant causes unsigned comparison; so negativevalues of in1 would compare as larger than 8’d64 */ assign uns_in1_lt_64 = in1 < 8'd64; assign lt = uns_lt + uns_in1_lt_64;endmodule
Example C-14 Signed Values
module m7 (in1, in2, lt, in1_lt_64); input signed [7:0] in1, in2; // two signed inputs output lt, in1_lt_64; assign lt = in1 < in2; // comparison is signed
// using a signed constant results in a signed comparison assign in1_lt_64 = in1 < 8'sd64;endmodule
Controlling Signs With Casting Operators
Use the Verilog 2001 casting operators, $signed() and $unsigned(),to convert an unsigned expression to a signed expression. InExample C-15, the casting operator is used to obtain a signedcomparator. Note that simply marking an expression as signed might
/ C-19HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
give undesirable results because the unsigned value might beinterpreted as a negative number. To avoid this problem, zero-extendunsigned quantities, as shown in Example C-15.
Example C-15 Casting Operatorsmodule m9 (in1, in2, lt); input signed [7:0] in1; input [7:0] in2; output lt; assign lt = in1 < $signed ({1’b0, in2}); //Cast to get signed comparator.
//Zero-extend to preserve interpretationof unsigned value as positive number.
Sign Conversion Warnings
When reading a design that contains signed expressions andassignments, HDL Compiler warns you when there are signmismatches by outputting a VER-318 warning. This warning can bedisabled by setting hdlin_warn_implicit_sign_conv to false.Default is true.
Note that beginning with the U-2003.06 release, HDL Compiler nolonger issues a signed/unsigned conversion warning (VER-318) if allof the following conditions are true:
• The conversion is necessary only for constants in the expression.
• The width of the constant would not change as a result of theconversion.
• The most significant bit (MSB) of the constant is zero(nonnegative).
Consider Example C-16. Here, even though Presto Verilog implicitlyconverts the type of the constant “1,” which is by default signed, tounsigned, the VER-318 warning is not issued because the abovethree conditions are true.
/ C-20HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
Example C-16 Mixed Unsigned and Signed Typesinput [3:0] a, b;output [5:0] z;assign z = a + b + 1;
In releases before U-2003.06, HDL Compiler would always issue a(VER-318) unsigned/signed warning if an arithmetic expressioncontained mixed unsigned and signed types, including constants,because implicit type conversion is required to make the expressioncompatible with the type being assigned. Note that integer constantsare treated as signed types by default.
The VER-319 warning indicates that the compiler has implicitlyconverted
• An unsigned expression to a signed expression
• A signed expression to an unsigned expression
or it has assigned
• An unsigned right-hand side to a signed left-hand side
• A signed right-hand side to an unsigned left-hand side
For example, in this code
reg signed [3:0] a;reg [7:0] c;
a = 4'sb1010;c = a+7'b0101011;
/ C-21HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
an implicit signed/unsigned conversion occurs—the signed operanda is converted to an unsigned value and the VER-318 warning"signed to unsigned conversion occurs" is issued. Note that a will notbe sign-extended. This behavior is in accordance with the Verilog2001 standard.
When explicit type casting is used, conversion warnings are notissued. For example, in the code above, to force a to be unsigned,you assign c as follows:
c = $unsigned(a)+7'b0101011;
no warning is issued.
Consider the following assignment:
reg [7:0] a;
a = 4'sb1010;
A VER-318 warning "signed to unsigned assignment occurs" isissued when this code is read. Note that although the left side isunsigned, the right side will still be sign-extended—in other words, awill have the value 8'b11111010 after the assignment.
If there is more than one implicit conversion in a line, such as theexpression assigned to c in the example below, only one warningmessage will be issued.
reg signed [3:0] a;reg signed [3:0] b;reg signed [7:0] c;
c = a+4'b0101+(b*3'b101);
/ C-22HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
Note that a and b are converted to unsigned values and because thewhole right side is unsigned, assigning it to c will also result in thewarning.
Note that integers are considered to have signed values and willgenerate VER-318 warnings accordingly. The code below usesintegers and will issue VER-318 warnings.
module m17(y, count1, z); input [3:0] y, count1;output [3:0] z; reg [3:0] x, z, count; always @ (y, count1) begin x = 2; count = count1; while (x < 15) begin count = count + 1; x = x + 1; end z = count; endendmodule
The code in Example C-17 generates eight VER-318 warnings.
Example C-17 Modules m1 Through m9 1 module m1 (a, z); 2 input signed [0:3] a; 3 output signed [0:4] z; 4 assign z = a; 5 endmodule 6 7 8 module m2 (a, z); 9 input signed [0:2] a; 10 output [0:4] z; 11 assign z = a + 3'sb111; 12 endmodule 13 14 15 module m3 (a, z);
/ C-23HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
16 input [0:3] a; 17 output z; 18 reg signed [0:3] x; 19 reg z; 20 always begin 21 x = a; 22 z = x < 4'sd5; /* note that x is signed and compared to 4'sd5,which is also signed, but the result of the comparison is put into z, an unsignedreg. This appears to be a sign mismatch; however, no VER-318 warning is issuedfor this line because comparison results are always considered unsigned. Thisis true for all relational operators. */ 23 end 24 endmodule 25 26 27 module m4 (in1, in2, out); 28 input signed [7:0] in1, in2; 29 output signed [7:0] out; 30 assign out = in1 * in2; 31 endmodule 32 33 34 module m5 (a, b, z); 35 input [1:0] a, b; 36 output [2:0] z; 37 wire signed [1:0] x = a; 38 wire signed [1:0] y = b; 39 assign z = x - y; 40 endmodule 41 42 43 module m6 (a, z); 44 input [3:0] a; 45 output z; 46 reg signed [3:0] x; 47 wire z; 48 always @(a) begin 49 x = a; 50 end 51 assign z = x < -4'sd5; 52 endmodule 53 54 module m7 (in1, in2, lt, in1_lt_64); 55 input signed [7:0] in1, in2; // two signed inputs 56 output lt, in1_lt_64; 57 assign lt = in1 < in2; // comparison is signed 58 59 // using a signed constant results in a signed comparison 60
/ C-24HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
61 assign in1_lt_64 = in1 < 8'sd64; 62 endmodule 63 64 65 module m8 (in1, in2, lt); 66 67 // in1 is signed but in2 is unsigned 68 69 input signed [7:0] in1; 70 input [7:0] in2; 71 output lt; 72 wire uns_lt, uns_in1_lt_64; 73 74 /* comparison is unsigned because of the sign mismatch; in1 is signedbut in2 is unsigned */ 75 76 assign uns_lt = in1 < in2; 77 78 /* Unsigned constant causes unsigned comparison; so negative values ofin1 would compare as larger than 8'd64 */ 79 80 assign uns_in1_lt_64 = in1 < 8'd64; 81 assign lt = uns_lt + uns_in1_lt_64; 82 83 endmodule 84 85 86 87 module m9 (in1, in2, lt); 88 input signed [7:0] in1; 89 input [7:0] in2; 90 output lt; 91 assign lt = in1 < $signed ({1'b0, in2}); 92 endmodule 93 94
The eight VER-318 warnings generated by the code inExample C-17 are shown in Example C-18.
Example C-18 Sign Conversion Warnings for m1 Through m9Warning: /usr/00budgeting/vhdl-mr/warn-sign.v:11: signed to unsigned assignmentoccurs. (VER-318)Warning: /usr/00budgeting/vhdl-mr/warn-sign.v:21: unsigned to signed assignmentoccurs. (VER-318)
/ C-25HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
Warning: /usr/00budgeting/vhdl-mr/warn-sign.v:21: ’a’ is read but does notappear in the sensitivity list of this ’always’ block. (ELAB-292)Warning: /usr/00budgeting/vhdl-mr/warn-sign.v:37: unsigned to signed assignmentoccurs. (VER-318)Warning: /usr/00budgeting/vhdl-mr/warn-sign.v:38: unsigned to signed assignmentoccurs. (VER-318)Warning: /usr/00budgeting/vhdl-mr/warn-sign.v:39: signed to unsigned assignmentoccurs. (VER-318)Warning: /usr/00budgeting/vhdl-mr/warn-sign.v:49: unsigned to signed assignmentoccurs. (VER-318)Warning: /usr/00budgeting/vhdl-mr/warn-sign.v:76: signed to unsigned conversionoccurs. (VER-318)Warning: /usr/00budgeting/vhdl-mr/warn-sign.v:80: signed to unsigned conversionoccurs. (VER-318)Presto compilation completed successfully.Current design is now ’/usr/00budgeting/vhdl-mr/m1.db:m1’m1 m2 m3 m4 m5 m6 m7 m8 m9
Table C-2 describes what caused the warnings listed inExample C-18.
Table C-2 Sign Mismatch Warnings (VER-318)
Module Cause of warning
m1, m4, and m7 These modules do not have any sign conversion warnings because thesigns are consistently applied.
m9 This module does not issue a VER-318 warning because, even though in1and in2 are sign mismatched, the casting operator is used to force the signon in2. When a casting operator is used, no warning is returned when signconversion occurs.
m2 In this module, a is signed and added to 3‘sb111 which is signed and hasa value of -1. However, z is not signed so the value of the expression onthe right, which is signed, will be converted to unsigned when assigned toz. The VER-318 warning “signed to unsigned assignment occurs” isissued.
/ C-26HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
New operator support is described in the following three sections:
• Variable Part-Select Overview
• Power Operator (**)
• Arithmetic Shift Operators (<<< and >>>)
m3 In this module, a is unsigned but put into the signed reg x. Here a will beconverted to signed and a VER-318 warning “unsigned to signedassignment occurs” is issued.Note that in line 22 (z = x < 4'sd5) x is signed and compared to 4'sd5, whichis also signed, but the result of the comparison is put into z, an unsignedreg. This appears to be a sign mismatch; however, no VER-318 warning isissued for this line because comparison results are always consideredunsigned. This is true for all relational operators.
m5 In this module, a and b are unsigned but they are assigned to x and y,which are signed. Two VER-318 warnings “unsigned to signed assignmentoccurs” are issued. In addition, y is subtracted from x and assigned to z,which is unsigned. Here the VER-318 warning “signed to unsignedassignment occurs” is also issued.
m6 In this module, a is unsigned but put into the signed register x. TheVER-318 warning “unsigned to signed assignment occurs” is issued.
m8 In this module, in1 is signed and compared with in2, which is unsigned,and 8‘d64, which is an unsigned value.
For each expression, the VER-318 warning “signed to unsignedconversion occurs” is issued.
Verilog 2001 introduces variable part-select operators. Theseoperators allow you to use variables to select a group of bits from avector. In some designs, coding with part-select operators improveselaboration time and memory usage. For more information on codingrecommendations, see “Use Variable Part-Select Operators toImprove Elaboration Time and Memory Usage” on page 2-46.
This section contains the following:
• Variable Part-Select Overview
• Example—Ascending Array and +:
• Example—Ascending Array and -:
• Example—Descending Array and -:
• Example—Descending Array and +:
Variable Part-Select Overview. A Verilog 1995 part-select operatorrequires that both upper and lower indexes be constant: a[2:3] ora[value1:value2].
The variable part-select operator permits selection of a fixed-widthgroup of bits at a variable base address and takes the following form:
• [base_expr +: width_expr] for a positive offset
• [base_expr -: width_expr] for a negative offset
The syntax specifies a variable base address and a known constantnumber of bits to be extracted. The base address is always writtenon the left, regardless of the declared direction of the array. The
/ C-28HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
language allows variable part-select on the left-hand side (LHS) andthe right-hand side (RHS) of an expression. All of the followingexpressions are allowed:
• data_out = array_expn[index_var +: 3](part select is on the right-hand side)
• data_out = array_expn[index_var -: 3] (part select is on the right-hand side)
• array_expn[index_var +: 3] = data_in (part select is on the left-hand side)
• array_expn[index_var -: 3] = data_in(part select is on the left-hand side)
The table below shows examples of Verilog 2001 syntax and theequivalent Verilog 1995 syntax.
The original HDL Compiler tool allows nonconstant part-selects if thewidth is constant; HDL Compiler (Presto Verilog) permits only thenew syntax.
The value of Index_Var determines the starting point for the bitsselected. The bits selected are shown below as a function ofIndex_Var.
Note:
• Ascending_Array[Index_Var +: 3] is functionally equivalent to thefollowing non-computable part-select:Ascending_Array[Index_Var : Index_Var + 2]
• Non-computable part-selects are not supported by the Veriloglanguage. Ascending_Array[7 +:3] corresponds to elementsAscending_Array[7 : 9] but elements Ascending_Array[8] andAscending_Array[9] do not exist. A variable part-select mustalways compute to a valid index, otherwise there will be asynthesis elaborate error and a run-time simulation error.
Ascending_Array [ 0 1 2 3 4 5 6 7
Index_Var = 0 • • • • • • • •
Index_Var = 1 • • • • • • • •
Index_Var = 2 • • • • • • • •
Index_Var = 3 • • • • • • • •
Index_Var = 4 • • • • • • • •
Index_Var = 5 • • • • • • • •
Index_Var = 6 not valid, synthesis/simulation mismatch; see note below.
Index_Var = 7 not valid, synthesis/simulation mismatch: see note below.
/ C-30HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
The value of Index_Var determines the starting point for the bitsselected. The bits selected are shown below as a function ofIndex_Var.
Descending_Array[Index_Var +: 3] is functionally equivalent to thefollowing non-computable part-select:
Descending_Array[Index_Var + 2 : Index_Var]
Non-computable part-selects are not supported by the Veriloglanguage. Descending_Array[7 +:3] corresponds to elementsDescending_Array[9 : 7] but elements Descending_Array[9] andDescending_Array[8] do not exist. A variable part-select must alwayscompute to a valid index, otherwise there will be a synthesiselaborate error and a run-time simulation error.
Power Operator (**)
This operator performs yx, as shown in Example C-19.
Example C-19 Power Operators
module m (a, z);
Descending_Array [ 7 6 5 4 3 2 1 0
Index_Var = 0 • • • • • • • •
Index_Var = 1 • • • • • • • •
Index_Var = 2 • • • • • • • •
Index_Var = 3 • • • • • • • •
Index_Var = 4 • • • • • • • •
Index_Var = 5 • • • • • • • •
Index_Var = 6 not valid, synthesis/simulation mismatch
Index_Var = 7 not valid, synthesis/simulation mismatch
/ C-33HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
input [3:0] a; output [7:0] x, y, z; assign z = 2 ** a; assign x = a ** 2; assign y = b ** c // where b and c are constantsendmodule
Arithmetic Shift Operators (<<< and >>>)
The arithmetic shift operators allow you to shift an expression andstill maintain the sign of a value, as shown in Example C-20. Whenthe type of the result is signed, the arithmetic shift operator (>>>)shifts in the sign bit; otherwise, it shifts in zeros.
Example C-20 Shift Operator Code and Gates
module s1 (A, S, Q);
input signed [3:0] A;
input [1:0] S;
output [3:0] Q;
reg [3:0] Q;
always @(A or S)
begin
// arithmetic shift right,//shifts in sign-bit from left
Q = A >>> S;
end
endmodule
o
o
o
o
o
/ C-34HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
map_to_module enhancement map_to_module supports tasks as well as functions. Fordetails, see “map_to_module and return_port_name”on page 7-17.
translate_off andtranslate_on
The //synopsys translate_off directive and the//synopsys translate_on directive are deprecated.
For details, see “Deprecated Features” on page C-58.
Version 2002.05
Automatic detection of input file type HDL Compiler can automatically detect if your design isa gate-level netlist or an RTL design and use the bestreader for your design. For details, see “Starting HDLCompiler” on page 1-4.
DC Ultra datapath optimization DC Ultra enables datapath extraction after timing-drivenresource sharing and explores various datapath/resource-sharing options during compile. For details,see “Datapaths” on page 2-38.
Finite State Machines (FSMs)verification
As of release 2002.05, enumerated types—used inFSMs—are recognized by both Formality and DC Ultra(compare_design -fsm and compile -verify) andthe typical FSM coding style, shown in Example 4-46 onpage 4-40, can be verified by Formality.
Automatic detection of finite statemachines (FSMs)
Automatic detection of finite state machines (FSMs)
In the 2002.05 release, HDL Compiler introducesautomatic detection and inference of finite statemachines. Combined with the new automatic FSMextraction feature in Design Compiler, FSM synthesis issimplified to just reading and compiling your code. Fordetails, see “Finite State Machines” on page 4-35.
Table C-3 Other HDL Compiler (Presto Verilog) Features (Continued)
HDL Compiler (Presto Verilog)New or enhanced features
Description
/ C-36HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
Displays synthesis progress Reports on synthesis progress. This is helpful forprinting out compile-time computations on parameters,or the number of times a loop executes.Uses the system task - $display.See “Using $display During RTL Elaboration” onpage C-52.
Models simulator behavior Simulates simulator behavior by allowing writing toout-of-bounds array locations using the new variablehdlin_dyn_array_bounds_check. See “Writing toOut-of-Bounds Array Locations” on page C-50.
Improved logic for left side arrayreferences
See “Improved Logic for Array Reference on the LeftSide” on page C-53.
Expanded MUX-OP inference Get MUX-OP’s for both case and if statements and rightside variable array reference x[a].See “Improved MUX_OP inference” on page C-53.
Sharing array references See “Sharing Array References” on page C-54.
Resource-sharing directives Manual control of resource sharing and implementationselection; these directives were not available in the newHDL Compiler (Presto Verilog) version 2000.11.See “Sharing Using hlo_resource_allocation” onpage 6-7.
Can preserve the value ofprocedure-local variables acrosscalls by inferring latches
New variablehdlin_infer_function_local_latchesSee “Changes From the Original HDL Compiler Tool” onpage C-60.
As of Version 2000.11
Arrays of instances See “Arrays of Instances” on page C-46.
defparam statement See “defparam Statement” on page C-38.
Table C-3 Other HDL Compiler (Presto Verilog) Features (Continued)
HDL Compiler (Presto Verilog)New or enhanced features
Description
/ C-37HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
The defparam statement allows overriding parameter values at lowerlevels in the hierarchy, enabling parameter values to be changed inany module instance. It works on submodules only, not on thecurrent module or modules elsewhere in the design. SeeExample C-21.
Example C-21 defparam Statement
module top (x, y, q);input x, y;output q;
defparam mid.bot.p2=2, mid.bot.p3=3;
Combinational while loop See “Combinational while Loop” on page C-40.
Resource sharing for conditionalexpressions
See “Sharing Using hlo_resource_allocation” onpage 6-7.
Divide operator See “Divide Operator” on page C-50.
Modulus operator Operator now supports constant and variable operands.
Shift operator inference Synthetic ops can now be inferred for shift operators(<<, >>)
Text macros Text macros are supported with sized constants.
hdlin_enable_vpp The functions of the preprocessor are built in to HDLCompiler, and the functions are automatically enabled.
`undefineall See See “`undefineall” on page 7-8.
New Verilog netlist reader The new reader incorporates algorithms that reduce thememory usage and CPU runtime of the read command.See “New Verilog Netlist Reader” on page C-55.
Table C-3 Other HDL Compiler (Presto Verilog) Features (Continued)
HDL Compiler (Presto Verilog)New or enhanced features
Description
/ C-38HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
In Example C-21, the original value of parameter p3 is 400. If youuse the defparam statement, the value is changed as it is passedfrom the top to the middle and finally to the bottom design, in whichp3 changes from 400 to 2. The defparam statement enables eachmodule instantiation to customize declared parameters. The result ofthe code in Example C-21 is p0=0, p1=1, p2=2, and p3=3.
There are three ways a module instantiation can override the valueof a parameter in a submodule. For example, assume that
module m1 (x,y); parameter p = 0;
You can override the parameter p by coding
defparam u1.p = 1;m1 u1 (x,y);
or,
/ C-39HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
To create a combinational while loop, write the code so that an upperbound on the number of loop iterations can be determined.Examples of supported combinational while loops are provided inExamples C-22 through C-24. An example of an unsupported loop isshown in Example C-25.
The loop iterative bound must be statically determinable; otherwisean error is reported. If the loop bound cannot be determined, theprogram limits the maximum number of iterations to the value set bythe hdlin_loop_iteration_limit variable and reports anELAB-900 error.
The original HDL Compiler tool supports loops with known upper andlower bounds and known constant steps. For example,
input [9:0] a;// ....i = 0;while ( i < 10 && !a[i] ) begin i = i + 1; // loop bodyend
The original HDL Compiler tool only supports while loops with eventstatements in them (implicit state machines). HDL Compiler (PrestoVerilog) relaxes these restrictions but still needs to be able todetermine an upper bound on the number of trips through the loop at
/ C-40HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
compile time. In HDL Compiler (Presto Verilog), there are no syntaxrestrictions on the loops. While loops that have no events withinthem, such as in the example below, are supported.
input [9:0] a;// ....i = 0;while ( i < 10 && !a[i] ) begin i = i + 1; // loop bodyend
To support this, HDL Compiler (Presto Verilog) interprets the looplike a simulator. It stops when the loop termination condition is knownto be false. Because it can’t tell when a loop is infinite, it stops andreports an error after an arbitrary (but user defined) number ofiterations (the default is 1000).
In the original HDL Compiler tool, disable is recommended for earlyloop exits; for example,
begin: loop_block for (i = 0; i < 10; i = i+1) begin if(a[i]) disable loop_block; // loop body endend
But HDL Compiler (Presto Verilog) allows additional conditions in theloop condition permitting more concise descriptions.
for (i = 0; i < 10 && a[i]; i = i+1) begin // loop bodyend
/ C-41HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
A loop must unconditionally make progress toward termination ineach trip through the loop, or it cannot be compiled. The examplebelow makes progress (that is, increments i) only when !done is trueand will not terminate.
while ( i < 10 ) begin if ( ! done ) done = a[i]; // loop body i = i + 1; endend
The modified version below, which unconditionally increments i, willterminate. This code creates the desired logic.
while ( i < 10 ) begin if ( ! done ) begin done = a[i]; end// loop body i = i + 1;end
In the next example, loop termination depends on reading valuesstored in x. If the value is unknown (as in the first and third iterations),HDL Compiler (Presto Verilog) assumes it might be true andgenerates logic to test it.
x[0] = v; // Value unknown: implies “if(v)”x[1] = 1; // Known TRUE: no guard on 2nd tripx[2] = w; // Not known: implies “if(w)”x[3] = 0; // Known FALSE: stop the loop
i = 0;while( x[i] ) begin // loop body i = i + 1;end
/ C-42HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
This code terminates after three iterations when the loop tests x[3],which contains 0.
In Example C-22, a supported combinational while loop, the codeproduces gates and an event control signal is not necessary.
Example C-22 Supported while Loop Codemodule modified_s2 (a, b, z);parameter N = 3;input [N:0] a, b;output [N:1] z;reg [N:1] z;integer i;always @(a or b or z) begin i = N; while (i) begin z[i] = b[i] + a[i-1]; i = i - 1; end endendmodule
In Example C-23, a supported combinational while loop, no matterwhat x is, the loop will run for 16 iterations at most because HDLCompiler (Presto Verilog) can keep track of which bits of x areconstant. Even though it doesn't know the initial value of x, it doesknow that x >> 1 has a zero in the most significant bit (MSB). Thenext time x is shifted right, it knows that x has two zeros in the MSB,and so on. HDL Compiler (Presto Verilog) can determine when xbecomes all zeros.
/ C-43HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
In Example C-24, a supported combinational while loop, HDLCompiler (Presto Verilog) knows the initial value of x and candetermine x+1 and all subsequent values of x.
Example C-24 Supported Combinational while Loop
Example C-25 is an unsupported combinational while loop.
HDL Compiler (Presto Verilog) cannot detect the initial value of x andtherefore cannot determine the value of x+1. Because it neverdetects what any bits of x are, it can never determine when x < 15and cannot create gates for this code.
Arrays of Instances
This feature enables instantiations of modules that contain a rangespecification, which, in turn, allows an array of instances to becreated. See See “Naming Arrays of Instances” on page 8-4. InExample C-26, the module test creates two pipeline registers, that is,a single pipeline with two stages.
Example C-26 Module Test: Code and Gates
In Example C-27, the module array_inst uses the test module tomake three pipelines three stages deep.
module test ( D, CK, Q );
input D, CK;
output Q;
reg Q0, Q;
always @ (posedge CK)
begin
Q0 <= D;
Q <= Q0;
end
endmodule
DQ
CLK
/ C-46HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
HDL Compiler (Presto Verilog) unwraps the array instantiation asshown below. Note that ck is connected to each instance, whereas dand q have one bit connected to each instance.
In this next example of array instantiation, x exactly matches thewidth of a on the submodule, so its full width is connected to eachinstantiated module.
In this next example of array instantiation, note that the declaredordering of bits [3:0] of y does not affect the instantiation of submod(compare to the previous example). Bits are connected by positionnot by number.
HDL Compiler (Presto Verilog) supports division where the operandsare not constant by instantiating a DesignWare divider. Note thatwhen you compile a design that contains an inferred divider, youmust have a DesignWare-Foundation license.
Example C-28 Divide Operator: Code and Gates
Writing to Out-of-Bounds Array Locations
Verilog simulators allow writing to out-of-bounds array locations; insimulation, this has no effect on the values stored in the array.However, HDL Compiler assumes that nonconstant array accessesare in bounds. This means that out-of-bounds accesses, as shownin Example C-29, might have unintended consequences and HDLCompiler will issue a warning that the access might be out of bounds.
// Value of addr could be 3..7: possibly out of bounds access
always @(posedge clk) mem[addr] = data;
// Read could be out of bounds too;// In simulation, 1’bx but for synthesis, 1’b0 or 1’b1
assign out = mem[out_addr];endmodule
If you get that warning and you can’t guarantee that the address willbe in-bounds, add an if statement, as shown in Example C-30,around the write to protect it by explicitly testing that the address isin bounds before the assignment.
Example C-30 Added Code to Insure In-Bounds Access
if ( addr < 4) mem[addr] = data; assign out = mem[out_addr];endmodule
The HDL Compiler (Presto Verilog) optionhdlin_dyn_array_bounds_check = true automatically addsthe code, as shown in Example C-30. This allows you to implementsimulator behavior and guarantees that no out-of-bounds access willaffect values stored in the array. This option increases the area of thedesign.
/ C-51HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
The $display system task is usually used to report on simulationprogress; however, HDL Compiler (Presto Verilog) executes $displaycalls as it sees them. It usually cannot tell the value of variables,except compile-time constants like loop iteration counters. It willexecute all the display statements on all the paths through theprogram as it generates the logic.
Note that because HDL Compiler (Presto Verilog) executes all$display calls, error messages from the Verilog source can beexecuted and can look like unexpected messages.
Using $display is useful for printing out any compile-timecomputations on parameters, or the number of times a loopexecutes. A $display example is shown below.
Using the original HDL Compiler, there is only one way to get aMUX_OP, and that is to use a case statement with the //synopsysinfer_mux directive.
With HDL Compiler (Presto Verilog), there are three ways to get aMUX_OP:
• Use a case statement with the //synopsys infer_muxdirective.
• Use an if statement with the //synopsys infer_mux directive.
• Use a variable array reference: x[a].
Note that, for Presto, the case statement must be parallel, otherwisea MUX_OP is not inferred and an error is reported. Even when the//synopsys parallel_case directive is used, if the casestatement is not truly parallel, an error is reported. The original HDLCompiler does not require parallel case statements. To avoidMUX_OPs for variable array references, sethdlin_build_selectop_for_var_index to true.
Sharing Array References
Array references with variable subscripts can be an overlookedcause of increased area. HDL Compiler (Presto Verilog) detectswhen you refer to the same array location more than once, andshares the logic. An example is shown below.
out1 = p2[var_index][0];
// ...
out2 = p2[var_index][1];
T = p2[var_index];
out1 = T[0];
// ...
out2 = T[1];
/ C-54HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
Here, HDL Compiler (Presto Verilog) computes p2[var_index] onlyonce and stores it in T, sharing the result in the T assignments.
Label and Resource Directives—Manual ResourceSharing
Label and resource directives are used for manually controllingresource sharing and implementation selection. They were notsupported in HDL Compiler (Presto Verilog) version 2000.11 but aresupported in HDL Compiler (Presto Verilog) 2001.08. See“Directives That Control Sharing” on page 6-9 and “Sharing Usinghlo_resource_allocation” on page 6-7.
if ( p ) z = a - b; // synopsys label op1 else z = c - d; // synopsys label op2
New Verilog Netlist Reader
The Verilog netlist reader incorporates algorithms that reduce thememory usage and CPU runtime of the read command. To use thenew reader, invoke the read command with the -netlist option asshown:
read -netlist -f verilog <file.v>
In Tcl mode, use
/ C-55HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
• Describing ops for a resourceOnly labels/hierarchical labels are allowed to describe the ops fora resource. If you want to put another resource in the definition,you need to inline that resource to fit the new syntax.
/ C-56HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
As of 2003.03, the macro SYNTHESIS replaces the macro DCalthough DC is still supported for backward compatibility. See“Standard Macros (SYNTHESIS, PRESTO, VERILOG_2001, andVERILOG_1995)” on page 7-6.
As of 2003.03, to suspend translation of the source code forsynthesis, use the macro SYNTHESIS and the appropriateconditional directives (`ifdef, `ifndef, `else, `endif) rather thantranslate_off and translate_on, as shown in the followingexample:
Example C-31 Coding for Simulation—Recommended Method
output Q; reg Q; // synopsys one_hot "RESET, SET" always @(posedge CLK or posedge RESET or posedge SET) if (RESET) Q <= 1’b0; else if (SET) Q <= 1’b1; else Q <= DATA; // synopsys translate_off always @ (RESET or SET) if (RESET + SET > 1) $write ("ONE-HOT violation for RESET and SET."); // synopsys translate_onendmodule
Beginning with the U-2003.06 release, the //synopsystranslate_off directive and the //synopsys translate_ondirective are changed. The code contained within these directives isignored and treated similar to the /* and the corresponding */comment delimiters. In previous releases, HDL Compiler and PrestoVerilog would parse, but not synthesize, the code within thesedirectives; if you wanted the code totally ignored, you needed to setthe variable hdlin_translate_off_skip_text to true. Thevariable hdlin_translate_off_skip_text is ignored becauseit’s function is incorporated into the translate_on/off directives.
/ C-59HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
Behavior that is changed by HDL Compiler (Presto Verilog) is listedin Table C-5.
Table C-5 Changes
Topic Description
Integers When synthesizing expressions containing variables declared as integer, theoriginal HDL Compiler tool did not consider the integer type to be a “hardware”data type and generated unsigned GTECH components; HDL Compiler(Presto Verilog) synthesizes the signed versions of GTECH arithmeticoperators for expressions whose type is integer. HDL Compiler (PrestoVerilog) behavior conforms more closely to the IEEE Standard.
Any designs that use the integer type for expressions that cannot becompletely evaluated at the time of elaboration may be affected by this change.However, computations that are known constants at compile time are notaffected (for example, calculation of for loop bounds). You should evaluatewhether this change will affect your design.
To obtain the original behavior, set hdlin_unsigned_integers to true. Notethat if you use any signs in your code, HDL Compiler (Presto Verilog) issues awarning and forces hdlin_unsigned_integers back to false.
Three-statedrivers
When all drivers of a multiply driven net are not declared as tri and a tristatecoding style is not used, that is, a conditional assignment of the variable to 1'bzin each block or continuous assignment that drives the variable, HDL Compilerissues an ELAB-366 error by default and no gates are created. You can sethdlin_prohibit_nontri_multiple_drivers to false to report a ELAB-365 warningfor this condition. With this variable false, you will get gates under all conditionsexcept when one of the drivers is a constant, which would create an illegaldesign. In this case, HDL Compiler issues an error.
/ C-60HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
HDL Compiler (Presto Verilog) allows only one resource declared in onesynopsys directive. However, multiple resources can be declared for onealways block.
If you want to include more than more one resource for an always block, youcan split them into several synopsys comments:
For example, the original HDL Compiler tool accepted
/* synopsys resource r0: ops = "a0",
resource r1: ops = "a1"; */
HDL Compiler (Presto Verilog) requires you to rewrite it as
/* synopsys resource r0: ops = "a0"; */
/* synopsys resource r1: ops = "a1"; */
ops for aresource
Only labels and hierarchical labels are allowed to describe the ops for aresource. If you want to put another resource in the definition, you need to writeinline code for that resource to fit the new syntax. For example, the code inExample C-36 was accepted by the original HDL Compiler tool but to beaccepted by HDL Compiler (Presto Verilog), the resource declarationschanged must be changed as follows: Remove the declaration for R1 and writeinline code for R1 in R2 as shown in Example C-37. Notice that L5/f1/L2 L5/f1/L3 L6/f1/L2 L6/f1/L3 has replaced L5/R1 L6/R1 in the R2 declaration.
Latches Latch inference improvement
HDL Compiler (Presto Verilog) can optionally preserve the value ofsubprogram-local variables across calls by inferring latches. See See“Persistence of Values Across Calls to Tasks” on page 2-9.
Table C-5 Changes (Continued)
Topic Description
/ C-61HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
The original Verilog HDL Compiler tool allows you to specify architectures formodules, which is not in accordance with IEEE Std 1364. In Presto Verilog, thisnonstandard behavior is not available. Module names of the form e__a (“e” and“a” separated by two underscores) are not interpreted as <architecture a>of <entity e>, but rather as <entity e__a>, as illustrated in this example:
module e__a(...);
...
endmodule
After analyzing the code in the example, you cannot elaborate it as elaboratee -arch a. It was possible to do so with the original HDL Compiler tool. Thenew functionality in Presto Verilog is consistent with standard Verilog. To runthe original HDL Compiler tool, set hdlin_enable_presto to false.
Variables innamed alwaysblock
In HDL Compiler (Presto Verilog), variables declared locally within a namedalways block may be put into a latch or flip-flop if necessary. The original HDLCompiler tool does not generate flip-flops for such reg declarations. To disablethis in HDL Compiler (Presto Verilog), sethdlin_infer_block_local_latches to false. The default and recommendedvalue for the variable is true.
MUX_OPinference
To infer a MUX_OP, Presto requires that the case statement be parallel,otherwise a MUX_OP is not inferred and an error is reported. Even when the//synopsys parallel_case directive is used, if the case statement is not
truly parallel, an error is reported. The original HDL Compiler does not requireparallel case statements.
Inferencereports
HDL Compiler (Presto Verilog) will indicate a N in the Bus column of theinference report if the flip-flop has different enable conditions. The original HDLCompiler indicates a Y (yes) in the Bus column if the flip-flop has differentenable conditions. An example is shown below.
reg [1:0] mem;
always @(posedge clk)
mem[addr] = data;
Table C-5 Changes (Continued)
Topic Description
/ C-62HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
Under certain conditions, HDL Compiler (Presto Verilog) generateserrors when incorrect syntax is used; the original HDL Compiler toolgenerates no warnings or errors under the same conditions. SeeExample C-33 through C-35.
New SyntaxErrors
Under certain conditions, HDL Compiler (Presto Verilog) generates errorswhen incorrect syntax is used; the original HDL Compiler tool generates nowarnings or errors under the same conditions. See Examples C-33 throughC-35.
translate_offandtranslate_on
The //synopsys translate_off directive and the //synopsystranslate_on directive are changed. Beginning with the U-2003.06 release,the code contained within these directives is ignored and treated similar to the/* and the corresponding */ comment delimiters. In previous releases, HDLCompiler and Presto Verilog would parse, but not synthesize, the code withinthese directives; if you wanted the code totally ignored, you needed to set thevariable hdlin_translate_off_skip_text to true. In 2003.06, the variablehdlin_translate_off_skip_text is ignored because it’s function isincorporated into the translate_on/off directives. In addion, thetranslate_off and translate_on directives are deprecated directives. See“Deprecated Features” on page C-58.
Table C-5 Changes (Continued)
Topic Description
/ C-63HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
Only labels and hierarchical labels are allowed to describe the opsfor a resource. If you want to put another resource in the definition,you need to write inline code for that resource to fit the new syntax.For example, the code in Example C-36 was accepted by the originalHDL Compiler tool but to be accepted by HDL Compiler (PrestoVerilog), the resource declarations changed must be changed asfollows: Remove the declaration for R1 and write inline code for R1in R2 as shown in Example C-37. Notice that L5/f1/L2 L5/f1/L3 L6/f1/L2 L6/f1/L3 has replaced L5/R1 L6/R1 in the R2 declaration.
Example C-36 Original HDL Compiler Code—Resource SharingWith Hierarchical Naming
module top (a, b, add, sub, inc, switch, z); input[3:0] a, b; input add, sub, inc, switch; output[3:0] z;
if (add) z = a + b; // synopsys label L4 else if (switch) z = sub_inc_dec (a, b, sub, inc); // synopsys label L5 else z = sub_inc_dec (b, a, sub, inc); // synopsys label L6 end
function [3:0] sub_inc_dec; input [3:0] a, b; input sub, inc;
begin: f1 if (sub) sub_inc_dec = (a-b); //synopsys label L1 else if (inc)
/ C-65HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
Often a single HDL design source can result in several differentdesign implementations. In such cases, HDL Compiler (PrestoVerilog) and the original HDL Compiler produce different butfunctionally equal designs. In some cases, differences occurbecause HDL Compiler (Presto Verilog) adheres more closely to theIEEE Std. Many portions of the original HDL Compiler were writtenbefore this standard existed. When generated logic is differentbetween designs, HDL Compiler (Presto Verilog) typically providesswitches so users can control behavior with an option. For example,HDL Compiler (Presto Verilog) infers a MUX_OP for a variable arrayreference by default—See “Improved MUX_OP inference” onpage 53. However, if you do not want to infer a MUX_OP for avariable array reference and instead want the SELECT_OP, you canset hdlin_build_selectop_for_var_index to false, which isthe original HDL Compiler behavior.
/ C-67HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
hdlin_auto_parallel_case_early true Performs automatic parallel-casedetection during IL passes
hdlin_auto_save_templates false Controls whether designs containingparameters are read in as templates.When set to true, the automatic netllistreader is disabled. See “Starting HDLCompiler” on page 1-4.
hdlin_black_box_pin_hdlc_style true For black box, uses HDLC pin naming(pin naming is affected by the inputsignal's type)
hdlin_branch_optimization true Attempts to optimize branchconditions
hdlin_build_selectop_for_var_index
false Specifies if SELECT_OPS should bebuilt for variable indexing on rhs
hdlin_call_stack_depth 1000 Sets maximum depth of call stack forfunctions and tasks
hdlin_check_no_latch false Controls whether a warning messageis issued if a latch is inferred from adesign.
hdlin_check_user_full_case true Warns if full_case is applied tonon-full case statements
/ C-68HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
hdlin_infer_fsm true Option enables and disables finitestate machine automatic detectionand inference. When set to false, FSMdetection is disabled.
hdlin_infer_function_local_latches
false Allows latches to be inferred forfunction- and task-scope variables
hdlin_keep_feedback false Preserves feedback to synch-data pinof SEQGEN.
hdlin_keep_signal_name default Keeps only those internal nets with thedont_munch pragma attached.
hdlin_keep_feedback_netname false When set to true, the automatic netllistreader is disabled. See “Starting HDLCompiler” on page 1-4.
hdlin_link_design false Links design
hdlin_loop_invariant_code_motion true Hoists loop-invariant code out of loops
hdlin_map_to_module true Processes map_to_module directivefor Verilog function
hdlin_map_to_operator true Processes map_to_operatordirective for functions and tasks.
hdlin_module_arch_name_splitting true Splits module names in Verilog intoentity/architecture portions by twosubsequent underscores.
hdlin_mux_oversize_ratio 100 Defined as the ratio of the number ofMUX inputs to the unique number ofdata inputs; when this ratio isexceeded, a MUX will not be inferredand the circuit will be generated withSELECT_OPs.
hdlin_mux_size_min 2 Sets the minimum number of datainputs for MUX inference
Table C-6 New Public Variables (Continued)
Name Default Description
/ C-70HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
hdlin_report_fsm false Enables and disables the finite statemachine inference report. For details,see “FSM Inference Report” onpage 4-50
hdlin_report_mux_op true Prints summary of MUX_OPs
hdlin_report_syn_cell false Prints summary of synthetic cells
hdlin_report_tri_state true Prints report for inferred three-stateelements
hdlin_selector_simplify_effort 1 Selects effort used in simplifyingselectors with constant inputs
hdlin_seqmap_search_depth 3 Obsoleted in U-2003.06; replaced withhdlin_seqmap_async_search_depthvariable andhdlin_seqmap_sync_search_depth
The obsoleted variable,hdlin_seqmap_search_depth,controlled how many levels of logicPresto Verilog would traverse to find aset or reset of a sequential element.
hdlin_seqmap_async_search_depth Controls how many levels of logicPresto Verilog will traverse whenlooking for asynchronous sets orresets.
hdlin_seqmap_sync_search_depth Controls how many levels of logicPresto Verilog will traverse looking forsynchronous sets or resets.
Table C-6 New Public Variables (Continued)
Name Default Description
/ C-72HOME CONTENTS INDEX
E-mail your comments about Synopsys documentation to [email protected]
hdlin_share_all_nodes false If true, shares arithmetic nodes even ifit may reduce the effectiveness ofresource sharing.
hdlin_share_all_operators false Share all operators that can beshared; share arithmetic nodes even ifit may reduce the effectiveness ofresource sharing. (that is, ignorehdlin_dont_share_nodetypes)
hdlin_subprogram_default_values false Reads tick-LEFT as default value forvariables instead of 0's
hdlin_translate_off_on true Heeds the translate_off andtranslate_on directives. Note thattranslate_off and translate_on aredeprecated directives. See“Deprecated Features” on page C-58.
hdlin_unsigned_integers false Allows you to obtain the original HDLCompiler behavior for signs when setto true. Note that if you use any signsin your code, the new HDL Compilerissues a warning and forceshdlin_unsigned_integers back to false
hdlin_upcase_names false Converts all Verilog names touppercase
hdlin_use_carry_in false Uses the carry-in input on adders