我有一個生成語句的問題。我生成一個流水線結構,基本的問題是,我需要除了索引另一個櫃檯或變量:生成語句中的信號或變量計數器
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的一代,我創建一個用作計數器的信號(端口映射(signVector(signCounter),lx(((i + 2)* dataSize-1)downto),但不能用作索引,錯誤是:「Actual(索引名稱)正式的「亞健康」是不是一個靜態的信號名字。」
任何幫助,將不勝感激:),TY
你'signCounter'分配'total'倍!記住所有'<='是**併發**分配。 – wap26