cambridgehackers / connectal

Connectal is a framework for software-driven hardware development.
MIT License
159 stars 46 forks source link

bsvdepend.py fails to find imported package whose name is expanded from macro #171

Closed kurocatus closed 4 years ago

kurocatus commented 4 years ago

It seems it's because bsc -E generates wired outputs instead of simply expands all macros.

Example test.bsv:

`define TEST TestPackage

import MyPackage::*;
import `TEST::*;

Outputs of bsc -E test.bsv:

 `line(/home/tianhaoh/Proj/playground/bsv///test.bsv,2,1,0)
import MyPackage::*;
import  `line(/home/tianhaoh/Proj/playground/bsv///test.bsv,1,14,1)TestPackage
 `line(/home/tianhaoh/Proj/playground/bsv///test.bsv,4,13,2)::*;

Outputs of bsvdepend.py test.bsv:

# BSV dependences
OBJMAKEFILE_DEP = 

test_BO  = obj/test.bo
test_DEP = obj/MyPackage.bo
test_INC = 
test_BSV = test.bsv

$(eval $(call BSV_BO_RULE, $(test_BO), $(test_BSV), $(test_DEP), $(test_INC)))