Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record support in VPI #2324

Open
1 of 3 tasks
Scafir opened this issue Jan 20, 2023 · 0 comments
Open
1 of 3 tasks

Record support in VPI #2324

Scafir opened this issue Jan 20, 2023 · 0 comments

Comments

@Scafir
Copy link

Scafir commented Jan 20, 2023

Description
It is currently not possible to access records using the VPI. This is a known issue, but currently does not have a bug report associated to it. I hope making this one will help tracking and awareness of the issue.

Related materials:

Expected behaviour
Records should be accessible through the VPI.

How to reproduce?
records.zip

-- sample.vhd
library ieee;
use ieee.std_logic_1164.all;

package recordPkg is

    type myRecordT is record
        a : std_logic;
    end record myRecordT;

end package recordPkg;

library ieee;
use ieee.std_logic_1164.all;
use work.recordPkg.all;

entity sample is
    port(
        rec : in myRecordT
    );
end sample;

architecture structure of sample is
begin
end structure;
# test_sample.py
import cocotb
from cocotb.triggers import RisingEdge, ClockCycles, Timer, FallingEdge
from cocotb.clock import Clock

@cocotb.test()
async def type_test(dut):
    # Reading
    print(dut.rec.a)

    # Writing
    dut.rec.a = 0

    await Timer(1, 'step')

    assert dut.rec.a == 0, "rec.a was not updated"
# Makefile
VHDL_SOURCES = $(PWD)/sample.vhd
MODULE = test_sample
TOPLEVEL = sample
SIM = ghdl
SIM_ARGS = "--wave=a.ghw"

include $(shell cocotb-config --makefiles)/Makefile.sim

Context
Please, provide the following information:

  • OS: Fedora Linux 37 (Workstation Edition)
  • Origin:
    • Package manager: version
    • Released binaries: tarball_url
    • Built from sources: 65a40a0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants