Payload firmware: Interface¶
The EMP framework top-level designs instantiate an entity - named
emp_payload
- and connects its input/output ports to the clocking
infrastructure, control bus, and input/output buffers, as described in
the introduction page. Various configurable aspects of the infrastructural
firmware (such as the I/O clock frequency and the depths of the I/O latency
buffers) are controlled by the values of constants
defined in the emp_payload_decl
package. This page outlines requirements
on the port map of the emp_payload
entity, and lists the constants that
users must define in the emp_project_decl
and tb_decl
packages.
emp_payload
entity¶
If you are developing a custom “physics algorithm” payload to integrate
into the EMP framework designs, this payload should be implemented in
an entity named emp_payload
, with the following input and output ports:
Name |
Type |
Description |
|
---|---|---|---|
in |
|
|
IPbus clock |
in |
|
|
IPbus reset |
in |
|
|
IPbus fabric (in) |
out |
|
|
IPbus fabric (out) |
in |
|
|
Auxiliary clocks for algorithms |
in |
|
|
Resets aligned to auxiliary clocks |
in |
|
|
Clock for main I/O data |
in |
|
|
Region-local reset
(clock domain: |
in |
|
|
|
in |
|
|
TTC counters |
out |
|
|
|
in |
|
|
Input data channels |
out |
|
|
Output data channels |
out |
|
|
|
out |
|
|
emp_project_decl
package¶
The emp_project_decl
package must define the following constants:
Name |
Type |
Description |
---|---|---|
|
|
Number of LHC bunches (should be 3564) |
|
|
Address width for I/O channel latency buffers (i.e. if 10, they can store
2^10 = 1024 words). Only required for builds, not for simulation.
|
|
|
Defines MMCM VCO frequency (multiple of 40MHz) in TTC block
Must be multiple of
CLOCK_RATIO and all elements of CLOCK_AUX_RATIO |
|
|
Determines clock frequency for I/O channels (i.e.
clk_p port)Frequency =
CLOCK_RATIO * 40MHz |
|
clock_ratio_array_t [From
emp_framework_decl ] |
Determines frequency of ‘auxilary’ clocks (i.e.
clk_payload port)Frequency of
clk_payload(i) = CLOCK_AUX_RATIO(i) * 40MHzE.g. With
constant CLOCK_AUX_RATIO : clock_ratio_array_t := (2, 4, 6); , thefrequencies of
clk_payload(0) , (1) and (2) are 240, 160 and 80MHz respectively |
|
region_conf_array_t [From
emp_device_types ] |
Defines whether MGT logic and buffers are instantiated in each I/O region |
Examples of the emp_project_decl
package for various boards can be found
in the emp-fwk
repository, under the projects/example
directory.
tb_decl
package¶
The tb_decl
package is only required when simulating the payload firmware;
it must define the following constants:
Name |
Type |
Description |
---|---|---|
|
|
Default path to the source file
(Used if
sourcefile generic not specified at runtime) |
|
|
Default path to the sink file
(Used if
sinkfile generic not specified at runtime) |
|
|
Number of frames to be played from source file |
|
|
Number of frames to be captured in sink file |
|
|
“Quiet” time at the beginning of the simulation before data from source is injected |
|
|
Index of the first frame from the source file that will be injected into the payload |
|
|
Number of clock cycles before the output data is captured |
|
|
Toggles playback of data in a continuous loop (rather than only playing the data once) |
|
|
Toggle whether the header frame - i.e. the first valid frame of the packet - is
removed before injecting data into the payload
|
|
|
Toggle whether a header frame is inserted before the first valid frame |
An example of the tb_decl
package can be found in the emp-fwk
repository, in file projects/examples/testbench/firmware/hdl/tb_decl.vhd
.