Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/systemrdl/flags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from absl import flags

HETERO_ARRAYS = flags.DEFINE_bool(
'experimental_hetero_arrays',
False,
'Support heterogeneous arrays.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces a new package dependency to Google's Abseil library, but with seemingly no benefit. None of the other PeakRDL utilities use Abseil for command line processing, nor is this systemrdl-compiler package a command-line tool.

13 changes: 13 additions & 0 deletions test/rdl_err_src/hetero_array.rdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
addrmap top {
reg reg_t {
field{} f;
};

regfile {
reg {
field {} f;
} some_reg;
} some_rf[2];

some_ref[0].some_reg->name = "foobar";
};
1 change: 1 addition & 0 deletions test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
absl-py
pytest
pytest-cov
parameterized
Expand Down
16 changes: 16 additions & 0 deletions test/test_hetero_array.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from absl.testing import flagsaver
from unittest_utils import RDLSourceTestCase

class TestHeteroArray(RDLSourceTestCase):
"""Test hetero arrays."""

maxDiff = None # pylint: disable=invalid-name

@flagsaver.flagsaver(experimental_hetero_arrays=False)
def test_disabled(self):
self.assertRDLCompileError(
['rdl_err_src/hetero_array.rdl'],
None,
'Use of array suffixes in dynamic property assignments is not'
' supported',
)
2 changes: 2 additions & 0 deletions test/unittest_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import logging
import re

import systemrdl.flags

from antlr4 import InputStream
from systemrdl import RDLCompiler
from systemrdl.parser import sa_systemrdl
Expand Down