我对生成语句有疑问。我正在生成一个管道架构,基本问题是除了 for 索引之外我还需要另一个计数器或变量:
architecture behav of blockPipelineCordic is
constant total: integer := stepNumber + stepNumber/pipeStep;
signal signVector: std_logic_vector( (stepNumber - 1) downto 0);
signal lx: std_logic_vector( ((total + 1)*dataSize - 1) downto 0);
signal ly: std_logic_vector( ((total + 1)*dataSize - 1) downto 0);
signal signCounter: integer := stepNumber - 1;
begin
stepGen:
for i in (total - 1) downto 0 generate
begin
signCounter <= signCounter - 1 when ((total - i) mod (pipeStep + 1) /= 0) else signCounter;
stepGen0: if( (total - i) mod (pipeStep + 1) /= 0 ) generate
begin U1: entity work.cordicStep(behav)
generic map ((totalStepNumber - 1) - i,dataSize)
port map(signVector(signCounter),lx(((i+2)*dataSize-1) downto (i+1)*dataSize),ly(((i+2)*dataSize-1) downto (i+1)*dataSize),lx(((i+1)*dataSize-1) downto i*dataSize),ly(((i+1)*dataSize-1) downto i*dataSize));
end generate stepGen0;
stepGen1: if( (total - i) mod (pipeStep + 1) = 0 ) generate
begin U2: entity work.registerModule(behav)
generic map (dataSize)
port map(clk,lx(((i+2)*dataSize-1) downto (i+1)*dataSize),lx(((i+1)*dataSize-1) downto i*dataSize));
end generate stepGen1;
stepGen2: if( (total - i) mod (pipeStep + 1) = 0 ) generate
begin U3: entity work.registerModule(behav)
generic map (dataSize)
port map(clk,ly(((i+2)*dataSize-1) downto (i+1)*dataSize),ly(((i+1)*dataSize-1) downto i*dataSize));
end generate stepGen2;
end generate stepGen;
. . .
在生成第一个结构时,我需要对 signVector 使用不同的索引,我创建了一个用作计数器的信号 (port map(signVector(signCounter),lx(((i+2)*dataSize-1) downto ) 但它不能用作索引错误是:“正式“子”的实际(索引名称)不是静态信号名称。”
任何帮助将不胜感激:),ty