VMM RAL LCA Features User Guide: N-2017.12-SP1, March 2018
VMM RAL LCA Features User Guide: N-2017.12-SP1, March 2018
VMM RAL LCA Features User Guide: N-2017.12-SP1, March 2018
User Guide
N-2017.12-SP1, March 2018
Copyright Notice and Proprietary Information
© 2018 Synopsys, Inc. All rights reserved. This Synopsys software and all associated documentation are proprietary to Synopsys,
Inc. and may only be used pursuant to the terms and conditions of a written license agreement with Synopsys, Inc. All other use,
reproduction, modification, or distribution of the Synopsys software or the associated documentation is strictly prohibited.
Synopsys, Inc.
690 E. Middlefield Road
Mountain View, CA 94043
www.synopsys.com
ii
Contents
Contents
iii
Contents
iv
RTL Generation from a RALF Description 1
The RALF specification contains all of the necessary information to
generate the RTL code implementing the specified registers.
Automatically generating the RTL code and the RAL model ensures
that they are kept up to date and requires that only one change be
made manually.
The ralgen option, -R, can be used to generate the register RTL
code for one or more blocks in the RALF file. When the -R option is
specified, ralgen generates the register RTL code for the block
specified as the top-level block or all the blocks and systems
included in the specified top-level system.
The RTL code is generated in separate files for each system, block,
register file, and register. The name of the generated file is
ral_typ_name_rtl.sv, where typ is one of sys, blk, rfile, or
reg and name is the unique, fully-scoped name of the system, block,
register file or register, as in the RALF file.
The generated register RTL code uses a single clock signal. You are
responsible for any clock domain crossing issues between the
generated register RTL and the clock domain of the bus interface.
All generated files are written in the directory specified with the –R
option. Each file contains a single module and is named according to
the module name with the .sv suffix. This allows you to override a
generated module with a user-provided one by locating the user-
defined module in a directory that is searched before the ralgen
generated RTL directory, using the +incdir option for simulation,
or the search-path variable in synthesis.
• User RTL
• Host-Side Protocol
• Design-Side Protocol
• Design-Side Protocol for External Fields
To use the generated RTL modules that implement the registers and
address decoders specified in the RALF file, instantiate the
appropriate block and host interfaces and block and system
modules. As long as the system and block type names do not
change, it is not necessary to change your code. As registers or
fields are modified, the corresponding design-side signals located in
the block interfaces will be modified. The latter changes may require
modifications in your code, but only for the portions that make use of
the changed registers or fields.
For example, the generated RTL from the following RALF file:
system s1 {
bytes 1;
system s2 @’h1000 {
bytes 1
block b4;
}
block b1 @’h2000;
}
File b1.sv:
`include "vmm_ral_host_itf.sv"
`include "ral_blk_b1_rtl.sv"
ral_blk_b1_itf ral_io();
ral_blk_b1_rtl ral(hst, ral_io.regs);
...
endmodule
ral_blk_b4_itf ral_io();
ral_blk_b4_rtl ral(hst, ral_io.regs);
...
endmodule
File s1.sv:
`include "vmm_ral_host_itf.sv"
`include "ral_sys_s1_rtl.sv"
`include "b1.sv"
`include "s2.sv"
File s2.sv:
`include "vmm_ral_host_itf.sv"
`include “ral_sys_s1_s2_rtl.sv”
`include "b4.sv"
The default implementation for the fields assumes that the host-side
protocol for read and write accesses is as shown in Figure 2-1.
Design-Side Protocol
The generated RTL provides the design side with the signals in
Table 2-2 (where functionally relevant). Unless otherwise specified,
all signals are active high and are sampled at the rising edge of the
clock. The direction is specified with respect to the generated RTL
code. It is not necessary for a design to make use of all output
signals, but all input signals must be driven. If a function provided by
an input signal is not used, it must be driven to an inactive state.
The default implementation for the fields assumes that the design-
side protocol for read and write accesses (where relevant) is as
shown in Figure 2-2.
The generated RTL assumes that the design-side protocol for read
and write accesses of an externally-implemented field are as shown
in Figure 2-3.
• Registers
• Blocks
• Memories
• Multiple Domains
• Register Arrays
• Register Files
• Register File Arrays
• Systems
• Unsupported RALF Constructs and Functionality
Registers
register r1 {
bytes 4;
field f10 @0 {bits 8; access rw;}
field f11 @16 {bits 8; access ro;}
}
endmodule
register r2 {
bytes 1;
field f20 {bits 2; access user0; }
field f21 {bits 3; access ru; }
field f22 {bits 3; access other;}
}
endmodule
Because there is only one fld_wr and fld_rd notification flag per
field, a warning will be issued by ralgen for every field spanning
multiple physical addresses.
register r3 {
bytes 2;
endmodule
Blocks
interface ral_blk_<blkname>_itf();
{<design-side signals>});
endinterface
block b1 {
bytes 2;
register r1;
register r2=rx;
register r2=ry @’h0100;
}
interface ral_blk_b1_itf();
endinterface
endmodule
Memories
block b2 {
bytes 4;
register r1;
memory m1 @’h0100 {
bits 16;
interface ral_blk_b2_itf();
endmodule
Multiple Domains
register r4 {
bytes 1;
field f1 {bits 8; access ro};
}
register r5 {
bytes 1;
field f2 {bits 8; access rw};
shared;
}
block b3 {
reg r1_sel;
reg north_r2_sel;
reg south_r2_sel;
reg [7:0] r2_in;
reg r2_wen;
reg r3_sel;
always @(*)
begin
r1_sel = ‘b0;
north_r2_sel = ‘b0;
south_r2_sel = ‘b0;
r2_in = ‘bx;
r2_wen = ‘b0;
r3_sel = ‘b0;
north.ack = 0;
south.ack = 0;
case (south.adr)
0: begin
r3_sel = south.sel[0];
south.ack = south.wen;
end
1: begin
south_r2_sel = south.sel[0];
r2_in = south.wdat[7:0];
r2_wen = south.wen;
south.ack = south.wen;
endmodule
Register Arrays
block b4 {
bytes 1;
register r4[256];
}
interface ral_blk_b4_itf();
endinterface
endmodule
Register Files
block b5 {
bytes 1;
regfile rf {
register r4;
register r4=r5;
}
}
reg r4_sel;
reg r5_sel;
always @(*)
begin
r4_sel = 0;
r5_sel = 0;
hst_ack = 0;
case (hst_adr)
0: begin
r4_sel = hst_sel[0];
hst_ack = hst_wen;
end
1: begin
r5_sel = hst_sel[0];
hst_ack = hst_wen;
end
endcase
end
endmodule
block b5 {
bytes 1;
regfile rf[256] {
register r4;
register r4=r5;
}
}
interface ral_blk_b5_itf();
endinterface
endmodule
<address decoding>
<readback muxing>
endmodule
system s1 {
bytes 1;
system s2 @’h1000 {
bytes 1
block b4;
}
block b1 @’h2000;
}
always @(*)
begin
s2.sel[0] = ‘b0;
b1.sel[1:0] = ‘b0;
if (hst.adr >= ‘h1000 && hst.adr <= ‘h1000 + 255) begin
s2.sel[0] = hst.sel[0];
endmodule
• Virtual registers
• Register files with a mix of shared and unshared registers
• Soft reset values
• Programmable base offset
• Programmable reset value
File vmm_ral_host_itf.v:
interface vmm_ral_host_itf(input bit clk,
input bit rstn);
logic [`VMM_RAL_ADDR_WIDTH-1:0] adr;
logic [`VMM_RAL_ADDR_BYTES-1:0] sel;
logic [`VMM_RAL_DATA_WIDTH-1:0] rdat;
logic [`VMM_RAL_DATA_WIDTH-1:0] wdat;
logic wen;
logic ack;
File vmm_ral_rw_field_rtl.v:
module vmm_ral_rw_field_rtl(
clk, rstn, fld_out,
hst_wdat, hst_sel, hst_wen,
fld_in, fld_wen);
parameter width = 1;
parameter reset = 0;
endmodule
File vmm_ral_ro_field_rtl.v:
module vmm_ral_ro_field_rtl(
clk, rstn, fld_in, fld_out);
parameter width = 1;
endmodule
File vmm_ral_wo_field_rtl.v:
module vmm_ral_wo_field_rtl(
clk, rstn, fld_out,
hst_wdat, hst_sel, hst_wen);
parameter width = 1;
parameter reset = 0;
endmodule
File vmm_ral_a0_field_rtl.v:
module vmm_ral_a0_field_rtl(
clk, rstn, fld_out,
hst_wdat, hst_sel, hst_wen,
fld_in, fld_wen);
endmodule
File vmm_ral_a1_field_rtl.sv:
module vmm_ral_a1_field_rtl(
clk, rstn, fld_out,
hst_wdat, hst_sel, hst_wen,
fld_in, fld_wen);
parameter width = 1;
parameter reset = 0;
endmodule
File vmm_ral_w1c_field_rtl.v:
module vmm_ral_w1c_field_rtl(
clk, rstn, fld_out,
hst_wdat, hst_sel, hst_wen,
fld_in, fld_wen);
parameter width = 1;
parameter reset = 0;
endmodule
File vmm_ral_rc_field_rtl.v
module vmm_ral_rc_field_rtl(
clk, rstn, fld_out,
hst_wdat, hst_sel, hst_wen,
fld_in, fld_wen);
parameter width = 1;
parameter reset = 0;
File vmm_ral_ru_field_rtl.v:
module vmm_ral_ru_field_rtl(
clk, rstn, fld_out,
hst_wdat, hst_sel, hst_wen,
fld_in, fld_wen);
parameter width = 1;
parameter reset = 0;
File vmm_ral_rw_notifier_rtl.v:
module vmm_ral_notifier_rtl(clk, rstn, sel, wen, rd, wr);
input sel, wen;
input clk, rstn;
output rd, wr;