Skip to content

Are std_logic_vectors not supported? #13

@Brandon-Valley

Description

@Brandon-Valley

Greetings,

Python I am using:

vhdl_file_path = "C:\\projects\\auto_wapper\\example\\demo.vhd"

# Open a source file
with open(vhdl_file_path, 'r') as fileHandle:
    content = fileHandle.read()


from pyVHDLParser.Token.Parser      import Tokenizer
from pyVHDLParser.Blocks            import TokenToBlockParser
from pyVHDLParser.Base              import ParserException

# get a token generator
tokenStream = Tokenizer.GetVHDLTokenizer(content)
# get a block generator
blockStream = TokenToBlockParser.Transform(tokenStream)



from pyVHDLParser.Blocks            import MetaBlock
for block in MetaBlock.BLOCKS:
        try:
            block.__cls_init__()
        except AttributeError:
            pass

try:
    for block in blockStream:
        print("{block!s}".format(block=block))
    for token in block:
        print("  {token!s}".format(token=token))
except ParserException as ex:
    print("ERROR: {0!s}".format(ex))
except NotImplementedError as ex:
    print("NotImplementedError: {0!s}".format(ex))    

When run on this .vhd file, everything works fine:

entity demo is
    port (
        a    : in  std_logic;
        -- b    : out std_logic_vector( 15 downto 0 );
        c    : out std_logic
    );
end entity demo;

But when I uncomment the line with the std_logic_vector as shown below, I receive the following error.

entity demo is
    port (
        a    : in  std_logic;
        b    : out std_logic_vector( 15 downto 0 );
        c    : out std_logic
    );
end entity demo;
pydev debugger: starting (pid: 18620)
[StartOfDocumentBlock]
[LinebreakBlock                                                                                                    at (line:   1, col:  1) .. (line:   1, col:  1)]
[Entity.NameBlock                                   'entity demo is'                                               at (line:   2, col:  1) .. (line:   2, col: 15)]
[LinebreakBlock                                                                                                    at (line:   2, col: 15) .. (line:   2, col: 15)]
[IndentationBlock                                    length=4 (4)                                                  at (line:   3, col:  1) .. (line:   3, col:  4)]
[PortList.OpenBlock                                 'port ('                                                       at (line:   3, col:  5) .. (line:   3, col: 10)]
[LinebreakBlock                                                                                                    at (line:   3, col: 11) .. (line:   3, col: 11)]
[IndentationBlock                                    length=8 (8)                                                  at (line:   4, col:  1) .. (line:   4, col:  8)]
[PortList.PortListInterfaceSignalBlock              'a    : in  std_logic'                                         at (line:   4, col:  9) .. (line:   4, col: 29)]
[PortList.DelimiterBlock                            ';'                                                            at (line:   4, col: 29) .. (line:   4, col: 29)]
[LinebreakBlock                                                                                                    at (line:   4, col: 30) .. (line:   4, col: 30)]
[IndentationBlock                                    length=8 (8)                                                  at (line:   5, col:  1) .. (line:   5, col:  8)]
ERROR: Expected ';', ':=' or whitespace after subtype indication.

Am I doing something wrong? Any recomendations on how I should proceed? Any and all assistance is greatly appreciated! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions