pnnl / OpenCGRA

OpenCGRA is an open-source framework for modeling, testing, and evaluating CGRAs.
Other
133 stars 22 forks source link

Question about run test #4

Closed LIUQyou closed 2 years ago

LIUQyou commented 3 years ago

Hi, sorry to bother you, but I encounter a problem running the demo. I am new to OpenCGRA and I am trying to run the CGRACL_FIR_demo_test.py. However, I am not sure where should I start. If I use

python3 ./cgra/test/CGRARTL_test.py

Then I will get

Traceback (most recent call last):
  File "./cgra/test/CGRARTL_test.py", line 16, in <module>
    from ...lib.opt_type              import *
ImportError: attempted relative import with no known parent package

If I use

./cgra/test/CGRARTL_test.py

I would get

./cgra/test/CGRARTL_test.py: line 10: $'\n==========================================================================\nCGRARTL_test.py\n==========================================================================\nTest cases for CGRAs with different configurations.\n\nAuthor : Cheng Tan\n  Date : Dec 15, 2019\n\n': command not found
from: can't read /var/mail/pymtl3
from: can't read /var/mail/pymtl3.stdlib.test
from: can't read /var/mail/pymtl3.stdlib.test.test_srcs
from: can't read /var/mail/...lib.opt_type
from: can't read /var/mail/...lib.messages
from: can't read /var/mail/...fu.flexible.FlexibleFuRTL
from: can't read /var/mail/...fu.single.AdderRTL
from: can't read /var/mail/...fu.single.ShifterRTL
from: can't read /var/mail/...fu.single.MemUnitRTL
from: can't read /var/mail/..CGRARTL
./cgra/test/CGRARTL_test.py: line 29: syntax error near unexpected token `('
./cgra/test/CGRARTL_test.py: line 29: `class TestHarness( Component ):'

But when I use py.test, it can pass the test. Is there any tutorial or example I can refer to? Thank you!

tancheng commented 3 years ago

Hi, you can just use pytest to run the demo or the other *_test.py for convenience. Example shows how to write up a script to run a demo with different models without pytest. But it is for a NoC rather than CGRA.

LIUQyou commented 3 years ago

Thanks.