Professional Documents
Culture Documents
Amendment Record: Issue No. Description of Amendment Change Request No. Release Date
Amendment Record: Issue No. Description of Amendment Change Request No. Release Date
7
Accord Confidential
Document No. ASM008 Page 1 of 59
Amendment Record
Change Release
Issue No. Description of Amendment
Request No. Date
Draft 1.0 First draft for comments 23/05/2001
Issue 1.1 Release 17/09/2002
Issue 1.2 Document Reviewed and Released as per 100103 25/05/2004
current requirement
Issue 1.3 Typo corrections and minor modifications 100113 10/08/2005
Issue 1.4 Design and coding guidelines according to 100181 04-08-2008
RMM guidelines incorporated
Issue 1.5 Synchronizer guidelines are incorporated 100209 06-07-2009
along with other best practices
Issue 1.6 Delimiters to VHDL comments (File header 100210 24-07-2009
and Sub-programs header) are inserted
Issue 1.7 Guideline for RULE 2.4 and 4.1 updated, 100406 in 16-06-2015
“Quality”
Is it ensured that the tool used to synthesize
100486 in
the RTL is not duplicating the synchronizer
“cust_details”
flip-flops due to fanout or any other reason.
Document is updated as per the current
requirement i.e. all identifiers maximum size
are increased to 32 characters and some
standards are changed to recommendation
from RULE.
ACC-VHD-STD 5.17 RULE is added.
Appendix B is updated for VHDL code review
checklist to keep the compliance check
against the check items simple.
Additional Note is added to ACC-VHD-STD
8.13 guideline.
ACC-VHD-STD 8.11 guideline is updated
with additional details.
VHDL Code examples provided were
updated to avoid conflicts with defined
guidelines.
Table of Contents
1 Objectives .................................................................................................................................................... 5
2 Scope............................................................................................................................................................ 5
3 References ................................................................................................................................................... 5
5 Assumptions ............................................................................................................................................... 6
8 Approvals ..................................................................................................................................................... 6
9 Responsibilities ........................................................................................................................................... 6
10 Distribution .................................................................................................................................................. 6
11 Trace-ability ................................................................................................................................................. 6
Table of Figures
1 Objectives
This document defines the standards for VHDL coding
2 Scope
The scope of this document is to define the guidelines for the VHDL coding in accordance with
requirements, digital logic design, and naming guidelines, for PLDs.
Recommendations [REC] are guidelines that are regarded as best practices, but are left to the
discretion of the designer to follow them.
3 References
➢ Michael Keating, and Pierre Bricaud, “Reuse Methodology Manual for System-On-Chip
Designs,” 3rd edition, 2002
➢ http://godavari/intranet/standards/Reuse_Methodology_Manual.pdf
http://godavari/intranet/standards/ModelGuide.pdf
Acronym Description
5 Assumptions
None
6 Outstanding issues
None
7 Document Control
This document is under change control. Any changes after internal base lining of the document
will be carried out in accordance with Change Control Procedure.
8 Approvals
Manager – GNSS Technology
9 Responsibilities
All the practitioners are responsible for ensuring adherence to this document.
Project Leaders are responsible to ensure that the team members adhere to the standards
specified in this document.
10 Distribution
The document will be available on intranet web page of M/s. Accord Global Technology Solutions
Private Limited.
11 Trace-ability
None
12.1 Trace-ability
ACC-VHD-STD 1.1 [RULE] The source code shall implement all the low level requirements correctly
ACC-VHD-STD 1.2 [RULE] The source code shall implement all the low level requirements completely
ACC-VHD-STD 1.3 [RULE] The source code shall not implement anything outside the low level
requirements
ACC-VHD-STD 1.4 [RULE] The components shall have inputs as defined in low-level requirements
ACC-VHD-STD 1.5 [RULE] The components shall have outputs as defined in low-level requirements
ACC-VHD-STD 1.6 [RULE] The source code shall not contain any statement/component that cannot
be verified
ACC-VHD-STD 1.7 [RULE] Any part of the code which can not be tested (coverage), shall have the
alternate means of verification (analysis, review, etc.)
ACC-VHD-STD 1.8 [RULE] The source code shall be traceable to all the low-level requirements
12.2 Design
12.2.1 Reset
ACC-VHD-STD 2.1 [RULE] System (with sequential logic) shall have a global reset, which can initialise
the system to a known state
ACC-VHD-STD 2.2 [RULE] Use only either synchronous or asynchronous type of resets throughout the
system
ACC-VHD-STD 2.3 [RULE] Reset signal connected to reset of flip-flops shall not be used in the data-
path.
i.e., The only logic function for the reset signal should be a direct clear of all
flip-flops. Never use the reset inputs of a flop to implement state machine
functionality. Reserving reset pins on flops for reset only makes it easier to
generate buffer trees for resets.
ACC-VHD-STD 2.4 [RULE] Each asynchronous reset de-assertion shall be synchronized with the clock
with which it is being used. Ensure the tool used to synthesize the RTL is
not duplicating the synchronizer flip-flops due to fanout or any other
reason.
ACC-VHD-STD 2.6 [REC] The internally generated resets should be used as synchronous resets
ACC-VHD-STD 2.7 [REC] If a conditional reset is required, create a separate signal for the reset
signal, and isolate the conditional reset logic in a separate module at the
top level of the design.
ACC-VHD-STD 2.8 [REC] It is preferred to have pulse stretching mechanism for synchronous resets
ACC-VHD-STD 2.9 [REC] There should be a glitch elimination mechanism for asynchronous resets
12.2.2 Clocks
ACC-VHD-STD 3.1 [RULE] Avoid clocks in data-path
ACC-VHD-STD 3.4 [REC] If the design requires a gated clock, model it in RTL using synchronous
load registers. This will allow the synthesis tool to insert the actual clock
gating logic.
ACC-VHD-STD 3.5 [REC] Avoid flip-flops operating on both the edges of the clock
ACC-VHD-STD 3.6 [REC] If the design must use a large number of both positive-edge and negative-
edge triggered flip-flops in your design, it may be useful to separate them
into different modules
ACC-VHD-STD 3.9 [REC] If the design must use a gated clock or an internally generated clock, keep
the clock generation circuitry as a separate module at the top level of the
design.
ACC-VHD-STD 4.2 [RULE] Signals entering the synchronizer shall directly come from the output of a
flip-flop
ACC-VHD-STD 4.3 [REC] Whenever synchronizer is used in the design, it shall be separately defined
and shall be used as a component
ACC-VHD-STD 4.4 [RULE] Signal from faster clock domain, entering the slower clock domain through
a synchronizer, shall be held stable for multiple cycles of slower clock
(depending on the number of stages in the synchronizer)
ACC-VHD-STD 4.5 [RULE] If the signal from the source clock domain is not stable for multiple cycles
of destination clock, use the capture circuit to detect the activity on that
signal and then synchronize the captured signal with the destination clock
ACC-VHD-STD 4.6 [RULE] Do not synchronize a signal from source clock domain, at multiple places,
in the destination clock domain
ACC-VHD-STD 4.7 [RULE] Avoid convergence of more than one control signals from the source clock
domain, in the destination clock domain
ACC-VHD-STD 4.8 [RULE] Use a synchronized enable signal, or handshake signals, to pass the multi-
bit signals across clock domain.
ACC-VHD-STD 4.9 [REC] Avoid the multi-bit signals crossing clock domain
ACC-VHD-STD 4.10 [RULE] There shall be a constraint file associated with each design
ACC-VHD-STD 4.11 [RULE] The constraint file name shall be design name suffixed with _ucf
ACC-VHD-STD 4.12 [RULE] The constraint file shall define the timing constraints and the location
constraints for all the port signals.
ACC-VHD-STD 4.13 [RULE] The constraint file shall have a header according to the guideline
ACC-VHD-STD 7.1
12.2.4 General
ACC-VHD-STD 5.1 [RULE] The enables for inputs and outputs shall be exclusive.
ACC-VHD-STD 5.4 [RULE] There shall not be any combinational feedback loops in the design
ACC-VHD-STD 5.5 [RULE] There shall not be any feed-throughs in the design
ACC-VHD-STD 5.9 [REC] Avoid timing-exceptions (false-paths and multi-cycle-paths) in the design
ACC-VHD-STD 5.11 [REC] For each sub-block of a hierarchical macro design, register all output
signals from the sub-block.
ACC-VHD-STD 5.12 [REC] Synthesis specific commands should be avoided in the source
code
For e.g.:
A_REG_PROS: process(clk_sys,rst_sys_n)
variable vprint : std_logic;
Begin
.
.
data_r<= data_a;
--synopsys translate _off
vprint:=data_r;
--synopsys translate_on
.
.
end process A_REG_PROS;
ACC-VHD-STD 5.14 [REC] Keep late-arriving signals with critical timing closest to the output of a logic
block.
ACC-VHD-STD 5.15 [REC] Keep memory interface pins at the top level of a macrocell to allow user
choice of memory implementation, interface and test.
ACC-VHD-STD 5.16 [REC] Reduce the number flip-flops falling into meta-stable state
The last state in a state machine shall be:
ACC-VHD-STD 5.17 [RULE] “when others =>”
Statement to encompass default states of all applicable signals end case.
12.3 Coding
12.3.1 File
ACC-VHD-STD 6.2 [RULE] File name shall not contain special characters except underscore
ACC-VHD-STD 6.3 [RULE] Length of file name shall be at least 4 characters, and shall not exceed 32
characters
ACC-VHD-STD 6.4 [RULE] File name shall be in lowercase and begin with a character
ACC-VHD-STD 6.5 [RULE] Name of the file should indicate the functionality
ACC-VHD-STD 6.6 [RULE] Name of the package file shall be suffixed with “_pkg”
ACC-VHD-STD 6.7 [RULE] Name of the library file shall be suffixed with ”_lib”.
ACC-VHD-STD 6.8 [RULE] Name of the configuration file shall be suffixed with “_cfg”
ACC-VHD-STD 6.10 [RULE] All file names shall have an extension ’. vhd’
ACC-VHD-STD 6.11 [RULE] Test bench file name shall be prefixed with 'tb_'
ACC-VHD-STD 6.12 [RULE] File name may contain numerals and underscores
ACC-VHD-STD 6.13 [REC] Number of lines in a file should not exceed 1000
12.3.2 Comments
ACC-VHD-STD 7.1 [RULE] Each file shall have file header at the beginning of the file and header shall
start at the first line and first column of the file.
--/*--------------------------------------------------------
----------------------------------------------------------
--License Information : Accord Software & Systems Pvt Ltd
-- No.37, K R Colony, Domlur Layout,
-- Bangalore - 560 071
-- Licensed software.
-- All rights reserved
-- Filename : acc_dbb1.vhd
-- Description : This module communicates with the
-- DSP.It receives the programmed data
-- form Dsp and transmits the results.
-- This module is the topmost module
-- which binds all the functional modules
-- including correlator, ptti counter
-- battery backup counter, clock manager
-- serial and ahb communication modules.
-- It instantiates thefollowing modules
-- 1. gps_cor
-- 2. clkmanager
-- 3. serial_comm
-- 4. amba_ahb_slave_driver
-- 5. ptti_counter
-- 6. bbcounter
-- 7. comm_interface
-- 8. acq_clk_ctrl
-- 9. memories
a) dpmem_chnl_ind_result
-- b) dpmem_chnl_ind_prog_params
-- Tools used : Xilinx ISE 9.1.03i
-- Modelsim SE 6.2g Simulator
For e.g. :
--/*****************************************************************
-- Function Name : CODEMIX_FUN
-- Description : The function performs code mixing
-- operation. It changes the sign of
-- Inphase/Qphase value based on the
-- code bit value
-- Inputs : arg_inp1 std_logic
arg_inp2 std_logic_vector(6 downto 0)
-- outputs : vres_std_val std_logic_vector(8 downto 0)
-- Libraries Used : IEEE.STD_LOGIC_UNSIGNED.ALL
IEEE.STD_LOGIC_UNSIGNED.ALL
-- Assumptions : None
--*****************************************************************/--
ACC-VHD-STD 7.3 [RULE] Process shall have a process header preceding the process definition
For e.g. :
--/***************************************************************
--** Process name : APY_DATA_CORDIC_PROS
--** Description : Generate time pulses to initiate CORDIC input
--** operations These pulses are generated only upon
--** a new data being recognised
--**************************************************************/--
ACC-VHD-STD 7.6 [RULE] For indentation use 2 spaces. Do not use tabs
ACC-VHD-STD 7.7 [REC] Use comment appropriately to explain process, functions, procedures
and declarations of types and subtypes. Use comments to explain
ports, signals and variables or group of signals or variables. Comments
for timing behaviour should be present
ACC-VHD-STD 7.9 [REC] The comments shall be descriptive and not just direct translations or
repetitions of the VHDL code.
ACC-VHD-STD 8.2 [RULE] Top entity port signals shall be of std_logic or std_logic_vector type
ACC-VHD-STD 8.3 [RULE] Length of entity name shall be at least 4 characters, and shall not
exceed 32 characters
ACC-VHD-STD 8.4 [RULE] Architecture of type Simulation should be prefixed with “sim_”, followed
by it’s entity name
ACC-VHD-STD 8.5 [RULE] Architecture of type Structural should be prefixed with “str_”, followed
by it’s entity name
ACC-VHD-STD 8.6 [RULE] Architecture of type RTL should be prefixed with “rtl_”, followed by it’s
entity name
ACC-VHD-STD 8.7 [RULE] Entity and all its architectures shall be in a single file
ACC-VHD-STD 8.8 [REC] Order of the port signal in ENTITY shall be in the following order
Inputs:
1.Clocks
2.Resets
3.Enables
4.Other control signals
5.data and address lines
Outputs:
1.Clocks
2.Resets
3.Enables
4.Other control signals
5.data
1.IN
2.OUT
3.INOUT
4.BUFFER
5.LINKAGE
For e.g.:
port (
clk_sys : in std_logic; -- System clock
rst_a : in std_logic; -- async. global reset
sclin : in std_logic; -- SCL input signal
sdain : in std_logic; -- SDA input signal
nextsda : in std_logic; -- Input for SDA output register
sdaout : out std_logic; -- SDA output signal
sdain_sync: out std_logic; -- Synchronized SDA input signal
start : out std_logic; -- Start condition detected
stop : out std_logic; -- stop conditions detected
rise_edge : out std_logic; -- Rising edge detected
fall_edge : out std_logic -- Falling edges detected
);
ACC-VHD-STD 8.9 [REC] Order of the port signal in COMPONENT shall be in the following order
Inputs:
1.Clocks
2.Resets
3.Enables
4.Other control signals
5.data and address lines
Outputs:
1.Clocks
2.Resets
3.Enables
4.Other control signals
5.data
1.IN
2.OUT
3.INOUT
4.BUFFER
5.LINKAGE
ACC-VHD-STD 8.10 [REC] Order of the port signal in port-mapping shall be in the following order
Inputs:
1.Clocks
2.Resets
3.Enables
4.Other control signals
5.data and address lines
Outputs:
1.Clocks
2.Resets
3.Enables
4.Other control signals
5.data
1.IN
2.OUT
3.INOUT
4.BUFFER
5.LINKAGE
ACC-VHD-STD 8.11 [RULE] Ports of mode BUFFER or LINKAGE shall not be used in the
synthesizable designs
ACC-VHD-STD 8.12 [RULE] The port in an entity port declaration shall not be a guarded port.
ACC-VHD-STD 8.13 [RULE] Do not use underscore characters ‘_’ in the entity port declaration for
the top-level entity of a HARD macro.
Note: The reason for the rule above is that VITAL uses underscores as
separators to construct names for SDF back-annotation from the SDF
entries.
ACC-VHD-STD 8.14 [RULE] Port names shall have same rules as the signals
ACC-VHD-STD 9.6 [RULE] Name of the signal/variable shall describe the functionality
ACC-VHD-STD 9.7 [RULE] Variable name shall start with character ‘v’
ACC-VHD-STD 9.8 [RULE] Length of signal name shall be at least 4 characters, and shall not
exceed 32 characters
ACC-VHD-STD 9.9 [RULE] Length of variable name shall be at least 4 characters, and shall not
exceed 32 characters
ACC-VHD-STD 9.10 [RULE] Tri-state internal signal name shall be suffixed with “_z”
ACC-VHD-STD 9.11 [RULE] Asynchronous signal name shall be suffixed with “_a”
ACC-VHD-STD 9.12 [RULE] Nth phase of the signal shall be suffixed with “_pn”
For e.g.:
signal enable_p1 : std_logic;
signal enable_p2 : std_logic;
signal enable_p3 : std_logic;
DELAY_PROS:process(clk_sys,rst_dsp_n)
begin
if(rst_dsp_n=’0’)
enable_p1 <= ’0’;
enable_p2 <= ’0’;
enable_p3 <= ’0’;
elsif(clk_sys=’1’ and clk_sys’event)
enable_p1 <= enable_a;
enable_p2 <= enable_p1;
enable_p3 <= enable_p2;
end if;
end process DELAY_PROS;
ACC-VHD-STD 9.13 [RULE] Register (flip-flop) output shall be suffixed with “_r”
ACC-VHD-STD 9.14 [RULE] Use a consistent name for the clock signal as clk. Use “clk_” as prefix,
if there are more than one clock signals
ACC-VHD-STD 9.15 [RULE] Use the same name for the reset throughout the hierarchy of the
design
ACC-VHD-STD 9.16 [RULE] Reset (both active high and active low) name shall be prefixed with
“rst_”
ACC-VHD-STD 9.17 [RULE] Active low reset shall be suffixed with “_n”
ACC-VHD-STD 9.18 [RULE] Active low signals/variables should be suffixed with “_n”
ACC-VHD-STD 9.19 [RULE] Hard coded numeric values shall not be used in the design
For e.g.:
constant C0_4BITS : std_logic_vector(3
downto 0):= “0000”;
constant C1_4BITS : std_logic_vector(3
downto 0):= “0001”;
COUTING_PROS:process(rst_n,clk_sys)
begin
if rst_n=’0’ then
counter<= C0_4BITS;
elsif clk_sys=’1’ and clk_sys’event then
counter<= counter+ C1_4BITS;
end if;
end process COUTING_PROS;
ACC-VHD-STD 9.20 [RULE] Shall use either (x downto 0) or (0 to x) for all multi-bit signals
throughout the design
For e.g.:
signal data_bus :std_logic_vector(0 to 15);
signal addr_bus :std_logic_vector(0 to 7);
or
signal data_bus:std_logic_vector(15 downto 0);
signal addr_bus:std_logic_vector( 7 downto 0);
ACC-VHD-STD 9.21 [REC] Name of the false path signals shall be suffixed with “_fp”
ACC-VHD-STD 9.22 [REC] Name of the signal before being registered into a register with the
same name should be suffixed with “_nxt”
For e.g.:
signal count_nxt: std_logi_vector(2 downto 0);
count_nxt <= count_r + 1 when count_r <= “110”
else “000”;
REG_PROS:process(clk_sys,rst_dsp_n)
begin
if(rst_dsp_n=’0’)
count_r <=“000”;
elsif(clk_sys=’1’ and clk_sys’event)
count_r <= count_nxt;
end if;
end process REG_PROS;
ACC-VHD-STD 9.23 [REC] Use a distinctive suffix for state variable names. Recommended
names are <name>_cs for the current state and <name>_ns for the
next state.
For e.g.:
signal state_cs : std_logic_vector(1 to 0);
signal state_ns : std_logic_vector(1 to 0);
ACC-VHD-STD 9.24 [REC] When writing synthesizable code, use signals instead of variables to
ensure that the simulation behavior of the pre-synthesis design
matches that of the post-synthesis netlist.
ACC-VHD-STD 10.2 [RULE] Length of instance name shall be at least 4 characters, and shall not
exceed 32 characters
For e.g.:
U_FIRST_INST: clock_generation
port map (
clk_sys => clk_sys,
rst_n => rst_n,
clk_out => clk_out
);
ACC-VHD-STD 10.3 [RULE] Each process shall have a label and label shall be suffixed with
“_PROS”
For e.g.:
REG_PROS: process(clk_sys)
begin
if clk_sys='1' and clk_sys'event then
if we_a='1' then
reg_r(addr_a) <= data_r;
end if;
end if;
end process REG_PROS;
ACC-VHD-STD 10.4 [RULE] Length of process label shall be at least 4 characters, and shall not
exceed 32 characters
ACC-VHD-STD 10.5 [RULE] All the signals that are read in a combinational process shall be listed
in the sensitivity list
For e.g.:
COMB_PROS: process(inpt_a, inpt_b)
begin
out_y <= inpt_a xor inpt_b;
end process COMB_PROS;
ACC-VHD-STD 10.6 [RULE] For an asynchronous reset, the reset signal name shall be specified in
the sensitivity list of a process along with the clock name
For e.g.:
ASYNC_RST_PROS: process(reset_n,clk_sys)
begin
if reset_n='0' then
reg_r(0) <= (others=>’0’);
reg_r(1) <= (others=>’0’);
elsif clk_sys='1' and clk_sys'event then
reg_r(addr_a) <= data_r;
end if;
end process ASYNC_RST_PROS;
ACC-VHD-STD 10.7 [RULE] For a synchronous reset, the reset signal name shall not be specified
in the sensitivity list of a process along with the clock name
SYNC_RST_PROS: process(clk_sys)
begin
if clk_sys='1' and clk_sys'event then
if reset_n='0' then
reg_r(0) <= (others=>’0’);
reg_r(1) <= (others=>’0’);
else
reg_r(addr_a) <= data_r;
end if;
end if;
end process SYNC_RST_PROS;
12.3.6 Types
ACC-VHD-STD 11.1 [RULE] User-defined type name shall be in uppercase
ACC-VHD-STD 11.2 [RULE] User-defined type name shall begin with a character
ACC-VHD-STD 11.3 [RULE] User-defined type name may contain numerals and underscores
ACC-VHD-STD 11.4 [RULE] Length of user-defined type name shall be at least 4 characters, and
shall not exceed 32 characters
ACC-VHD-STD 11.5 [RULE] User-defined type name shall not contain special characters except
underscore
ACC-VHD-STD 11.6 [RULE] User-defined type name shall be suffixed with “_TYP”
There should not be any delay constants in RTL code. These delay
constants may lead to pre-synthesis simulation and post-synthesis
simulation results mismatch.
For e.g.:
architecture str_state of example is
type STATE_TYP is (RESET,GO,STOP,DONE);
signal state_type :STATE_TYP ;
begin
P1_PROS:process(sig_1,sig_2,sig_3)
begin
if (sig_1=’0’ and sig_2=’0’)
state_type<= RESET;
elsif (sig_1=’0’ and sig_2=’1’)
state_type<=GO;
elsif(sig_1=’1’ and sig_3=’0’)
state_type<=STOP;
else
state_type<=DONE;
end if;
end process P1_PROS;
P2_PROS:process (state_type)
begin
case state_type is
when RESET => YELLOW<=’1’;
when GO => GREEN<=’1’;
when STOP => RED<=’0’;
when DONE => BLACK<=’0’;
end case;
end process P2_PROS;
end str_state;
For e.g.:
function ADD2_FUN (
addin1: std_logic_vector;
addin2: std_logic_vector)
return std_logic_vector is
begin
---body of the function
end ADD2_FUN;
ACC-VHD-STD 12.3 [RULE] Length of function name shall be at least 4 characters, and shall not
exceed 32 characters
ACC-VHD-STD 12.6 [RULE] Length of procedure name shall be at least 4 characters, and shall not
exceed 32 characters
ACC-VHD-STD 12.7 [REC] Use functions when possible, instead of repeating the same sections
of code. If possible, generalize the function to make it reusable.
12.3.8 Language
ACC-VHD-STD 13.1 [RULE] Shall comply with IEEE VHDL standard 1076-1993
ACC-VHD-STD 13.3 [RULE] VHDL or Verilog reserved words shall not be used as identifiers
ACC-VHD-STD 13.5 [RULE] Use std_logic rather than std_ulogic. Likewise, use std_logic_vector
rather than std_ulogic_vector.
operation.
ACC-VHD-STD 14.3 [RULE] Constant name may contain numerals and underscores
ACC-VHD-STD 14.4 [RULE] Constant name shall not contain special characters except underscore
ACC-VHD-STD 14.5 [RULE] Length of constant name shall be at least 4 characters, and shall not
exceed 32 characters
ACC-VHD-STD 14.9 [RULE] Length of generic name shall be at least 4 characters, and shall not
exceed 32 characters
ACC-VHD-STD 14.10 [REC] Package shall contain constants, functions and procedures used in the
design. And it’s file name same shall be suffixed with _pkg.vhd
ACC-VHD-STD 14.11 [RULE] Package name should indicate the design with which it is associated.
ACC-VHD-STD 14.12 [RULE] Package name shall be same as the package file
ACC-VHD-STD 14.13 [RULE] Length of package name shall be at least 4 characters, and shall not
exceed 32 characters
ACC-VHD-STD 14.14 [REC] If the number of constants in the design is more than 100, then there
shall be a separate constant’s package. The file name shall be
suffixed with “_const_pkg"
ACC-VHD-STD 14.16 [REC] If the number of functions and procedures in the design is more than
10, then there shall be a separate function and procedure package.
The file name shall be suffixed with “_fun_pror_pkg"
ACC-VHD-STD 14.17 [RULE] Package and package-body shall be in the same file.
12.3.10 Readability
ACC-VHD-STD 15.1 [RULE] Explicit mapping (named association rather than positional
association) shall be used for ports and generics
For e.g.:
U_INIT_ACQ_CHANNELS: initch
generic map(
G_DATA_LEN => G_DATA_LEN
)
port map (
--Inputs
clk_sys => clk_sys,
rst_clk_sys_n_r => rst_clk_sys_n_r,
--outputs
start_process8 => start_process8,
start_process9 => start_process9
);
ACC-VHD-STD 15.3 [RULE] Number of characters in a line shall not exceed 132 characters
ACC-VHD-STD 15.4 [REC] Loops and arrays should be used to improve the readability of the
source code. For e.g.:
ACC-VHD-STD 15.5 [REC] Sequential logic in the state machines, should use one process
without any combinational logic
For e.g.:
val_a<= not(input_a and input_b )
or (input_c and input_d);
12.3.11 Portability
ACC-VHD-STD 16.1 [REC] Do not use generate statements. There is no equivalent construct in
Verilog-95.
ACC-VHD-STD 16.2 [REC] Do not use block constructs. There is no equivalent construct in
Verilog.
ACC-VHD-STD 16.3 [REC] For arithmetic components, use the DesignWare Foundation Library
(for ASIC designs).
ACC-VHD-STD 17.1 [RULE] Test bench shall model the environment of the DUT
ACC-VHD-STD 17.2 [RULE] The same test bench shall be used for behavioural, and place and
route simulation
ACC-VHD-STD 17.3 [RULE] Single test bench shall be able to test multiple test cases
ACC-VHD-STD 17.4 [RULE] The PASS or FAIL verification status of the test case generation, shall
be automated
ACC-VHD-STD 17.5 [RULE] The test bench shall interact with the DUT, considering the timing
aspect of the design
ACC-VHD-STD 17.6 [REC] Use assertion statements to report the status of simulation during run-
time
ACC-VHD-STD 17.7 [RULE] Test bench shall read the inputs of a test case from a file, and log the
results into a file
ACC-VHD-STD 17.8 [RULE] Name of the input file, and output log file shall be at least 4 characters
and maximum of 32 characters
ACC-VHD-STD 18.2 [RULE] The “Source” directory shall contain “Design_files”, “Packages”, and
“Libraries”. (The block diagram is shown in Figure)
ACC-VHD-STD 18.3 [RULE] The “Design_files” sub-directory shall contain the Design RTL files.
ACC-VHD-STD 18.4 [REC] The “Packages” sub-directory shall contain the Design related
packages (which shall have functions, procedures, constants).
ACC-VHD-STD 18.5 [REC] The “Libraries” sub-directory shall contain the Design related libraries.
ACC-VHD-STD 18.6 [RULE] The “Synthesis” directory shall have sub-directories called as
“Scripts”, “Netlist”, ”Logs“, “Bitfile” and “Work”.
ACC-VHD-STD 18.7 [RULE] The “Scripts” sub-directory shall contain the synthesis specific scripts.
ACC-VHD-STD 18.8 [RULE] The “Netlist” sub-directory shall contain the design netlist, and SDF.
ACC-VHD-STD 18.9 [RULE] The “Logs” sub-directory shall contain the synthesis, translate, MAP,
and PAR reports.
ACC-VHD-STD 18.10 [REC] The “Bitfile” sub-directory shall contain the .bin, .bit, and .rbt files
ACC-VHD-STD 18.11 [RULE] The “Work” directory shall contain output files generated from
synthesis, translate, map and Place-and-Route tool.
ACC-VHD-STD 18.12 [RULE] The “Simulation” directory shall contain 7 sub-directories called
“Inputs”, “Libraries”, “TB”, “Scripts”, “RTL_res”, “Netlist_res”, and
“Work”.
ACC-VHD-STD 18.13 [RULE] The “Inputs” directory shall contain input stimulus file.
ACC-VHD-STD 18.14 [RULE] The “Libraries” directory shall contain simulation related library files.
ACC-VHD-STD 18.15 [RULE] The “TB” directory shall contain test bench files.
ACC-VHD-STD 18.16 [RULE] The “Scripts” sub-directory shall contain tool dependent scripts.
ACC-VHD-STD 18.17 [RULE] The “RTL_res” sub-directory shall contain the results of RTL
simulation.
ACC-VHD-STD 18.18 [RULE] The “Netlist_res” sub-directory shall contain the result of netlist
simulation (post-layout simulation).
ACC-VHD-STD 18.19 [RULE] The “Work” sub-directory shall contain the compiled design libraries
and simulation specific files.
ACC-VHD-STD 18.20 [RULE] If design is targeted for many technologies, each technology should
have its own directory, and named with its technology name
ACC-VHD-STD 18.21 [RULE] Each version should have the separate directory
Directory structure :
PROJECT NAME
Libraries Scripts
Logs
Libraries Netlist_res
Scripts Work
Inputs Work
ASM008, Accord Standards Manual © Accord Software & Systems Pvt. Ltd.
37, Krishna Reddy Colony, Domlur layout
Bangalore - 560071, INDIA
Accord’s Standards Manual Issue: 1.7
Accord Confidential
Document No. ASM008 Page 33 of 59
------------------------------------------------------------------
--License Information : Accord Global Technology Solutions Private
Limited.
-- No. 72 & 73, K R Colony, Domlur Layout,
-- Bangalore - 560 071
-- Licensed software. All rights reserved
--
-- Filename : reset_deassertion_synchrzr.vhd
--
-- Description : This file contains the logic to
-- synchronize the deassertion of the
-- reset w.r.t required clock.
--
-- Tools used : Xilinx ISE 9.1.03i
-- Modelsim SE 6.2g Simulator
-- Device selected : Virtex4(xc4vlx160-10ff1513,-10)
--
-- H/W Platform : Windows XP
--
-- Portability : VHDL-93
--
-- Functions : None
--
-- References : None
--
-- Author : G.S.Naveen
-- naveen.gs@accord-soft.com
--
-- Modification History : 1.0
-- Version Number| Date | Author |Change Request
-----------------|------------|-----------------|----------------
-----------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity reset_deassertion_synchrzr is
generic(
G_ACTIVE_RST_STATE : std_logic
);
ASM008 Controlled copy available in Intra-net Web Page and CM
© Accord Software & Systems Pvt. Ltd.
37, Krishna Reddy Colony, Domlur layout
Bangalore - 560071, INDIA
Accord’s Standards Manual Issue: 1.7
Accord Confidential
Document No. ASM008 Page 34 of 59
port(
rst_to_be_synchrnzd : in std_logic;
clk_synch : in std_logic;
scan_mode : in std_logic;
rst_synch_a : out std_logic
);
end reset_deassertion_synchrzr;
architecture reset_deassertion_synchrzr of
reset_deassertion_synchrzr is
signal sync_ff_1_qout_r : std_logic;
signal sync_ff_2_qout_r : std_logic;
signal sync_ff_3_qout_r : std_logic;
component clk_mux
port(
clk_in_0 : in std_logic;
clk_in_1 : in std_logic;
clk_select : in std_logic;
clk_out : out std_logic
);
end component;
begin
--*********************************************************************
--**PROCESS NAME:SYNC_RST_REMOVAL_PROS
--**DESCRIPTION : Synchronize the reset removal of the w.r.t the given
--** clock
--** It's a three stage synchronizer
--*********************************************************************
SYNC_RST_REMOVAL_PROS : process(rst_to_be_synchrnzd,clk_synch)
begin
if(rst_to_be_synchrnzd = '0') then
sync_ff_1_qout_r <= G_ACTIVE_RST_STATE;
sync_ff_2_qout_r <= G_ACTIVE_RST_STATE;
sync_ff_3_qout_r <= G_ACTIVE_RST_STATE;
U_RESET_MUX : clk_mux
port map(
clk_in_0 => sync_ff_3_qout_r,
clk_in_1 => rst_to_be_synchrnzd,
clk_select => scan_mode,
clk_out => rst_synch_a
);
end reset_deassertion_synchrzr;
U_SYNC_RESET : reset_deassertion_synchrzr
generic map(
G_ACTIVE_RST_STATE =>
)
port map(
rst_to_be_synchrnzd => ,
clk_synch => ,
scan_mode => ,
rst_synch_a =>
);
------------------------------------------------------------------
--License Information : Accord Software & Systems Pvt Ltd
-- No.37, K R Colony, Domlur Layout,
-- Bangalore - 560 071
-- Licensed software. All rights reserved
--
-- Filename : single_edge_data_synchrnzr.vhd
--
-- Description : This file contains the logic to
-- synchronize the given edge of the
-- signal w.r.t required clock.
--
-- Tools used : Xilinx ISE 9.1.03i
-- Modelsim SE 6.2g Simulator
--
-- Device selected : Virtex4(xc4vlx160-10ff1513,-10)
--
-- H/W Platform : Windows XP
--
-- Portability : VHDL-93
--
-- Functions : None
--
-- References : None
--
-- Author : G.S.Naveen
-- naveen.gs@accord-soft.com
--
-- Modification History : 1.0
-- Version Number| Date | Author |Change Request
-----------------|------------|-----------------|----------------
-----------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity single_edge_data_synchrnzr is
generic(
G_EDGE_TO_BE_SYNCNZD : std_logic
ASM008 ); Controlled copy available in Intra-net Web Page and CM
© Accord Software & Systems Pvt. Ltd.
37, Krishna Reddy Colony, Domlur layout
Bangalore - 560071, INDIA
Accord’s Standards Manual Issue: 1.7
Accord Confidential
Document No. ASM008 Page 38 of 59
port(
data_sig_to_be_synchrnzd : in std_logic;
rst_clk_synch : in std_logic;
clk_synch : in std_logic;
single_edge_synch_data_sig_r : out std_logic
);
end single_edge_data_synchrnzr;
architecture single_edge_data_synchrnzr of
single_edge_data_synchrnzr is
signal sync_edge_ff_1_qout_r : std_logic;
signal sync_dff_1_qout_r : std_logic;
signal sync_dff_2_qout_r : std_logic;
begin
--*******************************************************************
--**PROCESS NAME:SYNC_EDGE_PROS
--**DESCRIPTION : Synchronize the given edge of the signal w.r.t the
--* given clock
--*******************************************************************
SYNC_EDGE_PROS : process(data_sig_to_be_synchrnzd,clk_synch)
begin
if(data_sig_to_be_synchrnzd = not(G_EDGE_TO_BE_SYNCNZD)) then
sync_edge_ff_1_qout_r <= not G_EDGE_TO_BE_SYNCNZD;
elsif(clk_synch'event and clk_synch = '1') then
sync_edge_ff_1_qout_r <= G_EDGE_TO_BE_SYNCNZD;
end if;
end process SYNC_EDGE_PROS;
--********************************************************************
--**PROCESS NAME: DFF_EDGE_SYNC_PROS
--**DESCRIPTION : Synchronize the reset removal of the w.r.t the given
--** clock
--********************************************************************
DFF_EDGE_SYNC_PROS : process(rst_clk_synch,clk_synch)
begin
if(rst_clk_synch = '0') then
sync_dff_1_qout_r <= G_EDGE_TO_BE_SYNCNZD;
sync_dff_2_qout_r <= G_EDGE_TO_BE_SYNCNZD;
end single_edge_data_synchrnzr;
U_SINGL_EDG_SYNC3 : single_edge_data_synchrnzr
generic map(
G_EDGE_TO_BE_SYNCNZD =>
)
port map(
data_sig_to_be_synchrnzd => ,
rst_clk_synch => ,
clk_synch => ,
single_edge_synch_data_sig_r =>
);
------------------------------------------------------------------
--License Information : Accord Software & Systems Pvt Ltd
-- No.37, K R Colony, Domlur Layout,
-- Bangalore - 560 071
-- Licensed software. All rights reserved
--
-- Filename : dual_edge_data_synchrzr.vhd
--
-- Description : This file contains the logic to
-- synchronize the both the edges of the
-- signal w.r.t required clock.
--
-- Tools used : Xilinx ISE 9.1.03i
-- Modelsim SE 6.2g Simulator
--
-- Device selected : Virtex4(xc4vlx160-10ff1513,-10)
--
-- H/W Platform : Windows XP
--
-- Portability : VHDL-93
--
-- Functions : None
--
-- References : None
--
-- Author : G.S.Naveen
-- naveen.gs@accord-soft.com
--
-- Modification History : 1.0
-- Version Number| Date | Author |Change Request
-----------------|------------|-----------------|----------------
-----------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity dual_edge_data_synchrzr is
generic(
G_ACTIVE_RST_STATE : std_logic
);
port(
data_sig_to_be_synchrnzd : in std_logic;
rst_clk_synch : in std_logic;
clk_synch : in std_logic;
dual_edge_synch_data_out_r : out std_logic
);
end dual_edge_data_synchrzr;
--********************************************************************
--**PROCESS NAME: DFF_EDGE_SYNC_PROS
--**DESCRIPTION : Synchronize the reset removal of the w.r.t the given
--** clock
--** It's 2-stage synchronizer
--********************************************************************
DFF_EDGE_SYNC_PROS : process(rst_clk_synch,clk_synch)
begin
if(rst_clk_synch = '0') then
sync_dff_1_qout_r <= G_ACTIVE_RST_STATE;
sync_dff_2_qout_r <= G_ACTIVE_RST_STATE;
elsif(clk_synch'event and clk_synch = '1') then
sync_dff_1_qout_r <= data_sig_to_be_synchrnzd;
sync_dff_2_qout_r <= sync_dff_1_qout_r;
end if;
end process DFF_EDGE_SYNC_PROS;
end dual_edge_data_synchrzr;
U_DAT_SYNC1 : dual_edge_data_synchrzr
generic map(
G_ACTIVE_RST_STATE =>
)
port map(
data_sig_to_be_synchrnzd => ,
rst_clk_synch => ,
clk_synch => ,
dual_edge_synch_data_out_r =>
);
Compliance
ID Standard Remarks
(Yes/No)
Trace-ability
Design
i.e., The only logic function for the reset signal should
ACC-VHD-STD 3.5 Avoid flip-flops operating on both the edges of the clock
ACC-VHD-STD 4.13 The constraint file shall have a header according to the
guideline
ACC-VHD-STD 7.1
ACC-VHD-STD 5.1 The enables for inputs and outputs shall be exclusive.
Coding
ACC-VHD-STD 7.1 Each file shall have file header at the beginning of the file
and header shall start at the first line and first column of the
file.
ACC-VHD-STD 8.7 Entity and all its architectures shall be in a single file
Inputs:
1.Clocks
2.Resets
3.Enables
4.Other control signals
5.data and address lines
Outputs:
1.Clocks
ACC-VHD-STD 8.8
2.Resets
3.Enables
4.Other control signals
5.data
1.IN
2.OUT
3.INOUT
4.BUFFER
5.LINKAGE
1.Clocks
2.Resets
3.Enables
Outputs:
1.Clocks
2.Resets
3.Enables
4.Other control signals
5.data
1.IN
2.OUT
3.INOUT
4.BUFFER
5.LINKAGE
Inputs:
1.Clocks
2.Resets
3.Enables
4.Other control signals
5.data and address lines
ACC-VHD-STD 8.10
Outputs:
1.Clocks
2.Resets
3.Enables
4.Other control signals
5.data
1.IN
2.OUT
3.INOUT
4.BUFFER
5.LINKAGE
ACC-VHD-STD 8.14 Port names shall have same rules as the signals
ACC-VHD-STD 9.12 Nth phase of the signal shall be suffixed with “_pn”
Use a consistent name for the clock signal as clk. Use “clk_”
as prefix, if there are more than one clock signals
ACC-VHD-STD 9.14
For e.g.: signal clk_i2c_pll: std_logic;
ACC-VHD-STD 9.19 Hard coded numeric values shall not be used in the design
Test bench
ACC-VHD-STD 17.1 Test bench shall model the environment of the DUT
Directory Structure
ACC-VHD-STD 18.13 The “Inputs” directory shall contain input stimulus file.
ACC-VHD-STD 18.15 The “TB” directory shall contain test bench files.