3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-26 18:45:34 +00:00

$readmem[hb] file inclusion is now relative to the Verilog file

Signed-off-by: Rodrigo Alejandro Melo <rodrigomelo9@gmail.com>
This commit is contained in:
Rodrigo Alejandro Melo 2020-01-31 18:20:22 -03:00
parent a1c840ca5d
commit 7b3fe404ab
2 changed files with 4 additions and 2 deletions

View file

@ -2886,7 +2886,8 @@ AstNode *AstNode::readmem(bool is_readmemh, std::string mem_filename, AstNode *m
int meminit_size=0;
std::ifstream f;
f.open(mem_filename.c_str());
std::string path = filename.substr(0, filename.find_last_of("\\/")+1);
f.open(path + mem_filename.c_str());
yosys_input_files.insert(mem_filename);
if (f.fail())