Vhdl 将双向记录分配给另一条记录的可重用方法
我正在使用UVVM AXI流VVC。它将AxiStream接口定义为记录类型,为了简洁起见,在本问题中缩短了该接口 所以,给定这个记录类型,它包含双向的信号Vhdl 将双向记录分配给另一条记录的可重用方法,vhdl,Vhdl,我正在使用UVVM AXI流VVC。它将AxiStream接口定义为记录类型,为了简洁起见,在本问题中缩短了该接口 所以,给定这个记录类型,它包含双向的信号 type t_axistream_if is record tdata : std_logic_vector; -- Going in tvalid : std_logic; -- Going in tready : std_logic; -- Going out end
type t_axistream_if is record
tdata : std_logic_vector; -- Going in
tvalid : std_logic; -- Going in
tready : std_logic; -- Going out
end record;
我想要一个可重用的方法,可以对tdata
中的字节重新排序,并将此记录的两个实例相互连接
这是我正在寻找的功能。以下VHDL功能正常:
-- dutInput and axisMasterIf are constrained instances of the record.
dutInput.tData <= reverseBytes(axisMasterIf.tData);
dutInput.tValid <= axisMasterIf.tValid;
axisMasterIf.tReady <= dutInput.tReady;
--dutInput和axisMasterIf是记录的受约束实例。
dutInput.tData反向字节(inIf.tData),
tValid=>inIf.tValid,
tReady=>open——这不会编译。
);
末端功能;
--这可以编译,但当从进程内调用过程时,信号似乎不会持续分配。
程序反向(
信号inIf:inout t\U axistream\U if;
信号输出if:inout t\U axistream\U if
)是
开始
outIf.tData关于此块:
--这是编译的,但是当从进程中调用过程时,信号似乎不会被持续分配。
程序反向(
信号inIf:inout t\U axistream\U if;
信号输出if:inout t\U axistream\U if
)是
开始
outIf.tData什么算“不工作”?你能提供一份报告吗?为什么您要在两个方向上驱动axi接口?AXI是单向的,我试图添加更多的解释。这是AXI流,但AXI也具有就绪信号。Ready将始终以与其他公交车相反的方向行驶。把这两件事放在同一份记录里并不总是有帮助的,但这是无关紧要的;接口是由UVVM提供的,我需要解决它。我可以创建一个MCVE,但现在不行。如果没有如何使用反向过程的上下文,很难给出答案。VHDL实现不能比参数列表更深入地查看子程序以识别驱动程序,记录参数将具有所有元素的驱动程序。(流程声明性项过程可以驱动不在其参数列表中的信号,但不允许重用)。如果没有除函数以外的重用,则无法看到反向字节。你的读者可能会认为你谈论的是不同类型的端点操作或功能。OP从来没有提到过时钟进程,特别是说它不是用于合成的。考虑到UVVM,这很可能是在程序测试台过程中。但这些都是猜测,因为没有MCVE。
dutInput <= reverse(axisMasterIf);
axisMasterIf.tReady <= dutInput.tReady;
-- or using a procedure
-- reverse(axisMasterIf, dutInput)
-- If I set outIf <= reverse(inIf) this function will drive the
-- TReady-signal and I will get U due to multiple drivers.
-- When I set TReady as open, it just doesn't compile.
function reverse(inIf : t_axistream_if) return t_axistream_if is
begin
return (
tData => reverseBytes(inIf.tData),
tValid => inIf.tValid,
tReady => open -- This doesn't compile.
);
end function;
-- This compiles, but the signals don't seem to become continually assigned when the procedure is called from within a process.
procedure reverse(
signal inIf : inout t_axistream_if;
signal outIf : inout t_axistream_if
) is
begin
outIf.tData <= reverseBytes(inIf.tData);
outIf.tValid <= inIf.tValid;
inIf.tReady <= outIf.tReady;
end procedure;
-- This compiles, but the signals don't seem to become continually assigned when the procedure is called from within a process.
procedure reverse(
signal inIf : inout t_axistream_if;
signal outIf : inout t_axistream_if
) is
begin
outIf.tData <= reverseBytes(inIf.tData);
outIf.tValid <= inIf.tValid;
inIf.tReady <= outIf.tReady;
end procedure;