我正在使用 Xilinx ISE 并使用 CORE Generator & Architecture Wizard 生成了一个内存。
问题是它创建了一个写使能信号 ( wea
) 作为 STD_LOGIC_VECTOR(0 downto 0) 并导致类型不匹配:
Line ###: Type error near encnt ; current type std_logic; expected type std_logic_vector
怎么投
encnt
,这是 std_logic,到一位 std_logic_vector?(ISE 不允许我从内存文件中更改 wea。)
最佳答案
这是这些 IP 块的一个非常常见的场景。您可以轻松关联您的 std_logic
像这样的信号:
wea(0) => encnt,
而不是关联
wea
总的来说,您只是将一个元素关联起来 (0)
.如 wea
只有一个元素,这分配了整个向量。
关于casting - 将 STD_LOGIC 连接到一位 STD_LOGIC_VECTOR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49851974/