AR# 10454: XST - Using the image attribute to define RPMs
AR# 10454
|
XST - Using the image attribute to define RPMs
Description
Keywords: VHDL, RLOC, image, synthesis, macro
Urgency: Standard
General Description: The predefined image attribute is supported in XST. This attribute converts an integer value to a string, and it can be used to compute the value of the RLOC attribute.
Solution
The following example illustrates the creation of a register bank with RLOC constraints:
In the first entity, the generic placement of a single flip-flop is defined by an RLOC attribute. The RLOC value calculation is based on the generic values.
In the second entity, using a LOOP constraint, a number of flip-flops are instantiated. The placement of each instance is defined via generics.
Example
First Entity:
entity single_reg is generic (row, col: integer:= 1; slice: integer:= 0); ... ATTRIBUTE RLOC OF u1: LABEL IS "R" & integer'image (row_fun(row)) & "C" & integer'image(col) & ".S" & integer'image(slice);
-- Note that functions may be used to calculate values. ... u1: FD port map (D=>D, C=>CLK, Q=>Q);
Second Entity:
entity reg_bank is ... my_for: for i in 1 to 8 generate u11: single_reg generic map (row=>i, col=>1, slice=>0) port map (D=>D(i-1), CLK=>CLK, Q=>Q(i-1)); end generate;
XST Log File
Analyzing generic Entity <single_reg> (Architecture <struct>). row = 1 col = 1 slice = 0 Set property "user_defined = RLOC R1C1.S0" for instance <u1> in unit <single_reg>. ... Analyzing generic Entity <single_reg> (Architecture <struct>). row = 2 col = 1 slice = 0 Set property "user_defined = RLOC R2C1.S0" for instance <u1> in unit <single_reg0>. ...