Forum Discussion
1 Reply
- Altera_Forum
Honored Contributor
I am pretty sure SOPC will only export STD_LOGIC or STD_LOGIC_VECTOR. One thing you could do would be to create a function set that converts the record into STD_LOGIC, then use that to export. So, something like:
Then in your top level of the file you use for the SOPC just pass the converted signal out. You will have to change things when you modify the record size and add signals, but this may be easier than you think. You could also get tricky and try and use variables and constants for the length of the STD_LOGIC_VECTOR that is returned and pass those as arguments into the SOPC system. Just a thought and will leave it up to you to implement, if it is realistically possible. Hope this helps. KevinLIBRARY ieee; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; package dma_pkg IS --------------------- -- Records --dma records type dma_rec IS record data : std_logic_vector(63 downto 0); sop : std_logic; eop : std_logic; valid : std_logic; end record; function clr_dma_rec return dma_rec; function to_std_logic_vector(val : dma_rec) return std_logic_vector; function to_dma_rec(val : std_logic_vector) return dma_rec; end dma_pkg; package body dma_pkg is --dma record function clr_dma_rec return dma_rec IS variable rtn : dma_rec; begin rtn.data := (others => '0'); rtn.sop := '0'; rtn.eop := '0'; rtn.valid := '0'; return rtn; end clr_dma_rec; function to_std_logic_vector(val : dma_rec) return std_logic_vector IS variable rtn : std_logic_vector(66 downto 0); begin rtn(63 downto 0) := val.data; rtn(64) := val.sop; rtn(65) := val.eop; rtn(66) := val.valid; return rtn; end to_std_logic_vector; function to_dma_rec(val : std_logic_vector) return dma_rec IS variable rtn : dma_rec; begin rtn.data := val(63 downto 0); rtn.sop := val(64); rtn.eop := val(65); rtn.valid := val(66); return rtn; end to_dma_rec; end package body dma_pkg;