Connecting a STD_LOGIC to a one bit STD_LOGIC_VECTOR

夙愿已清 提交于 2019-12-23 20:44:28

问题


I'm using Xilinx ISE and generated a memory using the CORE Generator & Architecture Wizard.

The problem is that it created a write enable signal (wea) as a STD_LOGIC_VECTOR(0 downto 0) and that results in a type mismatch:

Line ###: Type error near encnt ; current type std_logic; expected type std_logic_vector

How can I cast encnt, which is std_logic, to a one bit std_logic_vector?

(ISE doesn't allow me to change wea from the file of memory.)


回答1:


This is a pretty common scenario with these IP blocks. You can easily associate your std_logic signal like this:

wea(0) => encnt,

Instead of associating wea as a whole, you are just associating that one element (0). As wea only has one element, this assigns the whole vector.



来源:https://stackoverflow.com/questions/49851974/connecting-a-std-logic-to-a-one-bit-std-logic-vector

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!