Академический Документы
Профессиональный Документы
Культура Документы
REGISTER DESCRIPTION
GUIDELINE
Contents
Revision History
Scope
4.5 Address
4.6 Formula
4.7 Where
4.8 Option
4.9 Description
4.10 HDL_PATH
4.11 Width
4.13 Field
5 addrmap file
1
2
3
4
5
5
5
6
6
6
7
7
7
7
7
8
9
9
11
12
13
14
14
16
17
Revision History
Revision History
Revision
Date
Author
Description
1.0
Oct.30,
2014
dienlc@atvn.com.vn
First Edition
1.1
Aug.05,
2015
dienlc@atvn.com.vn
Page 3 of 20
Scope
Scope
An Arrive Technologies Register description file (atreg file) is a source file which will be fed to the following
generators to generate database for some environments
Page 4 of 20
Page 5 of 20
File name should convey general infomartion of the sub-block/block/chip which the file represent for.
Recommendation format should be: <product>_<block>_<subblock>*_RD.atreg
Example: af5top_pklut_rd.atreg
Page 6 of 20
A chip can be divided into several blocks by functions. So its a good idea to partition the whole chip
registers to small parts based on their functions, each part is contained in a file that we call a register
description file. Here are guidelines for this partition
Each file MUST be defined an MAX_ADDRESS. The final address of any register in the file MUST
not be more than this MAX_ADDRESS. Thus we have range of address for the file is
[MIN_ADDRESS:MAX_ADDRESS]
The range address of register file [MIN_ADDRESS:MAX_ADDRESS] MUST not overlap range of
address of any another.
Reset: Registers are used for chip/block soft reset purpose. We should collect all block soft reset
bits and put into a same register.
Page 7 of 20
EXAMPLE
Page 8 of 20
#-
[SYNTAX]
//[Begin:] [any string, dont care]
[SYNTAX]
//[Register Full Name:] [any string]
[SYNTAX]
//[RTL Instant Name:] [register_instance_name]
4.5 Address
[MUST]
This is a single line to define address of register
Page 9 of 20
[SYNTAX]
These three extra-formats below are supported, but not recommended to use (Because every register can
be declared by Format1 and Format2):
For this format this access policy will override access policy declared in field [4.12][4.12]
Example:
//Address: 0x35_0000(RO)
Format 4: For a single register but can be accessed through many addresses. This is called a shared
address register
//[Address:] [min_address1(access_policy)] %% [min_address2(access_policy)]
4.6 Formula
[OPTION]
This is a single line to define address of register which is obtained by a formula.
If the Fomula is present, then the final address of register will be obtained from this Formula.
If the keyword Address is present in the Formula, then this Address will be replaced by [min_address}
value in the section 4.5.
2015 Arrive All Rights Reserved
Page 10 of 20
[SYNTAX]
//[Formula:][address_formula]
[EXAMPLE]
//Formula: Address+port_id
4.7 Where
[OPTION]
This is a single line to define variables/index/iterate which are used in the formula in 4.6
[SYNTAX]
//[Where:][{$var1(min_value-max_value): var1 description}] [ %% {$var2(min_value-max_value): var2
description}][%% more ...]
4.8 Option
[OPTION]
This is a single line to define modality which is used to access to register.
Indirect registers:
Some registers are not mapped in the address map and can only be accessed indirectly. In other words,
reading and writing of unmapped registers is done through mapped registers. For example, you could read
from an unmapped register by writing the address into a mapped address register and then reading the data
from a data register.
Page 11 of 20
[SYNTAX]
//[Option:] [:indirect_register: <indirect_addr_register> %%
<addr_field_name_in_indirect_address_register> %% <indirect_data_register>]
[EXAMPLE]
The hash table 65Kx64bits of the classifier block is implemted with indirect access mode. The table can be
accessed use two register.
Page 12 of 20
######################################################################################
// Begin:
// Register Full Name: Hash Table Indirect Address Register
// RTL Instant Name: hash_indrect_addr
// Address : 0x30_0000
// Description : Indirect Address Register for accessing HASH table of Classifier
block
// Width: 32
// Register Type: {Status}
// Field: [31:18] %% Reserved %% Reserved %% RO %% 0x0C %% 0x0C
// Field: [17:17] %% Done %% 0: Not done, 1: Done %% RO %% 0x16 %%
0x16
// Field: [16:16] %% Read_Not_Write %% 0: Read, 1: Write %% RW %% 0x0
%% 0x0
// Field: [15:0] %% hash_idx %% hash index for access table %% RW %% 0x0
%% 0x0
//End:
######################################################################################
Indirect Data Register name: hash_indirect_data
######################################################################################
// Begin:
// Register Full Name: Hash Table Indirect Data Register
// RTL Instant Name: hash_indrect_data
// Address : 0x30_0001
// Description : Indirect Data for accessing HASH table of Classifier block
// Width: 64
// Register Type: {Status}
// Field: [63:0] %% info %% info %% RW %% 0x0 %% 0x0
//End:
######################################################################################
Then we can declare the hash table as below:
######################################################################################
// Begin:
// Register Full Name: Hash Table Indirect Data Register
// RTL Instant Name: hash_indrect_data
// Address : 0x00_0000 - 0x00_FFFF
// Description : Indirect Data for accessing HASH table of Classifier block
// Option: indirect_register: hash_indirect_addr %% hash_index %%
hash_indirect_data
// Width: 64
// Register Type: {Config}
// Field: [63:0] %% hash_entry %% hash entry %% RW %% 0x0 %% 0x0
//End:
######################################################################################
4.9 Description
[OPTION]
2015 Arrive All Rights Reserved
Page 13 of 20
This is a single line or multiple line to put more description about this register
[NOTE]: Identifying description in the next line by key word %% at the end of current line
[SYNTAX]
//[Description:] [Any description]
4.10 HDL_PATH
[OPTION]
This is a single line to declare an relative HDL_PATH of register. This HDL_PATH will be concatenated with
HDL_ROOT_PATH to form a FULL_PATH for register. HDL_ROOT_PATH is declared in the addrmap file for
every block.
We split HDL_PATH of any register/ram/array into to three sub-HDL_PATH, and they will be constructed to
create a full HDL_PATH from top module down to that register/ram/array
FULL_HDL_PATH=RGM_HDL_ROOT_PATH.CORE_HDL_PATH.REG_HDL_PATH
TOP_HDL_PATH: is defined by a verilog defined macro that will be fed to Simulator. Commonly we
add `RGM_HDL_ROOT_PATH macro to proj_top_ben.f. Example: proj_top_ben.f:-define
RGM_HDL_ROOT_PATH=testtop.AF6CCI0012.af6cci0012rtlcore
CORE_HDL_PATH: is defined per (RTL block/RD file) under the design top-core, this parameter is
defined in proj_top.addrmap file . Example: inst_type:AF5ACC_CE08_RD_GLBR
hdl_path:GLBL_INST[].glbl
[SYNTAX]
//[HDL_PATH:] [hierarchy path]
Block module framer is instantiated in the ocnrtlcore module with name: iocn_framer
Inside the framer module we have a register interrupt enable which is instantiated with name
reg_interrupt_enable
Then the HDL_PATH for this register will be declared as below:
Page 14 of 20
#################################################################################
# ************
# * Diagnostic DDR Error Counter*
# ************
// Register Full Name: OCN Interrupt Enable
// RTL Instant Name : ddr_status_cnt
// Address : 0x12
// Formula :
// Where :
// Description : this register is number of value error data when compare between
data read & data has been written, and indicate valid counter data
//HDL_PATH: icon_framer.reg_insterrupt_enable
// Width : 32
// Register Type: {Counter}
//#Field: [Bit:Bit] %% Name %% Description %% Type %% Reset %% Default
// Field: [31:0] %% interrupt_en %% interrupt enable %% RW %% 0x0 %% 0x0
The OCN block is instantiated in the module rtltop with name iocncore
The rtltop is instantiated in testtop module with name irtltop
Page 15 of 20
#################################################################################
# ************
# * PACKET EDITOR By Pass Configuration*
# ************
// Register Full Name: PACKET EDITOR By Pass Configuration
// RTL Instant Name : icfg_editbypass
// Address : 0x17
// Formula : {0x17 + idx164 + idx28 + idx3}
// Where : {$idx1(03): index 1} %% {$idx2(07): index 2} %% {$idx3(07):
index 3}
// Description : this register is used to enable the By Pass mode for Packet Editor
// HDL_PATH : icfg_editbypass.block_A[$idx1].block_B[$idx2].ram.ram[$idx3]
// Width : 32
// Register Type: {Config}
//#Field: [Bit:Bit] %% Name %% Description %% Type %% Reset %% Default
// Field: [31:01] %% Unused %% NA %% RW %% 0x0 %% 0x0
// Field: [0] %% PktEditByPassEn %% ByPass Packet Editor Enable %% R/W
%% 0x0 %% 0x0
4.11 Width
[MUST]
This is a single line to indicate size in bit of the register. The number of bit MUST be multiple of 16
[SYNTAX]
//[Width:] [decimal_number]
[SYNTAX]
//[Register Type:] [{Type1|Type2|}]
Page 16 of 20
4.13 Field
[MUST]
This is a single line or muliple lines to define a field. A register may include a single or multiple fields. A
searching machine will search untill found 5 keys of %%
[SYNTAX]
//[Field:] [bit_range] %% [field_name] %% [field_description] %% [access_policy] %%
[field_soft_reset_value] %% [field_hard_reset_value]
For a single bit then format is: [bit], Ex: [15], or [15:15]
For a range of bit then format is: [high:low], Ex: [15:13]
[field_name] is name of field, need follow verilog signal name syntax. The field_name SHOULD BE
NAMED same as actual signal name in RTL code. This is a good definition that we can use this name
for searching RTL code in debug later on
Description
Effect of a
Read on
Current
Field Value
Status
Read Only
No effect
No effect
RW
Config
Read, Write
No effect
RC
Status
Read Clears
All
No effect
RS
UNKNOW
No effect
WRC
UNKNOW
WRS
UNKNOW
WC
Status
Write, Read
Clears All
Write, Read
Sets All
Write Clears
All
WS
Status
WSRC
UNKNOW
WCRS
UNKNOW
Access
Policy
Use
Case
RO
Write Sets
All, Read
Clears All
Write Clears
All,Read Sets
All
Sets
0s
Sets
1s
Sets
0s
Sets
1s
all bits to
all bits to
all bits to
all bits to
Readback
Value
Current
Value
Current
value
Current
value
Current
value
Current
value
Current
value
Current
value
Current
value
No effect
No effect
Current
value
Current
value
Page 17 of 20
Access
Policy
Use
Case
Description
W1C
Interrupt
Write 1 to
Clear
W1S
Interrupt
Write 1 to
Set
W1T
UNKNOW
Write 1 to
Toggle
W0C
Interrupt
Write 0 to
Clear
W0S
Interrupt
Write 0 to
Set
W0T
UNKNOW
Write 0 to
Toggle
W1SRC
UNKNOW
Write 1 to
Set, Read
Clears All
W1CRS
UNKNOW
Write 1 to
Clear, Read
Sets All
W0SRC
UNKNOW
Write 0 to
Set, Read
Clears All
W0CRS
UNKNOW
Write 0 to
Clear, Read
Sets All
WO
Config
WOC
UNKNOW
WOS
UNKNOW
W1
UNKNOW
Write Once
WO1
UNKNOW
Write Only,
Once
Write Only
Write Only
Clears All
Write Only
Sets All
Effect of a
Read on
Current
Field Value
Readback
Value
No effect
Current
Value
No effect
Current
value
No effect
Current
value
No effect
Current
value
No effect
Current
value
No effect
Current
value
Current
value
Current
value
Current
value
Current
value
No effect
Undefined
No effect
Undefined
No effect
Undefined
No effect
Current
value
No effect
Undefined
Example
// Field: [15:8] %% Day %% Day Synthesized FPGA %% R_O %% 0x16 %% 0x16
[SYNTAX]
2015 Arrive All Rights Reserved
Page 18 of 20
Page 19 of 20
5 addrmap file
5 addrmap file
This is a file with extension addrmap. File will be defined an address map for atreg source files. It looks like
below. File will be used by Register Model Generator of TestBench environment to generate register model
database. So files need to be followed template.
Section 1: Including all atreg files. Note that comment out any line by inserting // at the beginning
of lines
Section 2: Defining typename for each register file (block/sub-block name). This will be hooked to
register instance name to create register class or register address macro
Page 20 of 20