aboutsummaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorRodrigo Alejandro Melo <rmelo@inti.gob.ar>2020-02-06 10:10:29 -0300
committerRodrigo Alejandro Melo <rmelo@inti.gob.ar>2020-02-06 10:10:29 -0300
commitda485dc007b4dd9f72b8682a6809627e1f04513a (patch)
tree17a20c27b6521e48073d6b677c0586908f12cf77 /frontends
parent665a967d879d4ed5af8d3518e6cd02afae244f97 (diff)
downloadyosys-da485dc007b4dd9f72b8682a6809627e1f04513a.tar.gz
yosys-da485dc007b4dd9f72b8682a6809627e1f04513a.tar.bz2
yosys-da485dc007b4dd9f72b8682a6809627e1f04513a.zip
Modified $readmem[hb] to use '\' or '/' according the OS
Signed-off-by: Rodrigo Alejandro Melo <rmelo@inti.gob.ar>
Diffstat (limited to 'frontends')
-rw-r--r--frontends/ast/simplify.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index 52f157c6e..fe0412699 100644
--- a/frontends/ast/simplify.cc
+++ b/frontends/ast/simplify.cc
@@ -2904,7 +2904,12 @@ AstNode *AstNode::readmem(bool is_readmemh, std::string mem_filename, AstNode *m
std::ifstream f;
f.open(mem_filename.c_str());
if (f.fail()) {
- std::string path = filename.substr(0, filename.find_last_of("\\/")+1);
+#ifdef _WIN32
+ char slash = '\\';
+#else
+ char slash = '/';
+#endif
+ std::string path = filename.substr(0, filename.find_last_of(slash)+1);
f.open(path + mem_filename.c_str());
yosys_input_files.insert(path + mem_filename);
} else {