aboutsummaryrefslogtreecommitdiffstats
path: root/gowin/arch.cc
diff options
context:
space:
mode:
authorYRabbit <rabbit@yrabbit.cyou>2021-07-03 08:23:25 +1000
committerYRabbit <rabbit@yrabbit.cyou>2021-07-03 08:23:25 +1000
commit5c5982c50a63c83dba2f68e9d5dcc2bb67cc4c67 (patch)
tree0b89dba370de1903afc4c116c0df635fbde69164 /gowin/arch.cc
parent9443267717cf0ea2278f800127db7fd9e962650f (diff)
downloadnextpnr-5c5982c50a63c83dba2f68e9d5dcc2bb67cc4c67.tar.gz
nextpnr-5c5982c50a63c83dba2f68e9d5dcc2bb67cc4c67.tar.bz2
nextpnr-5c5982c50a63c83dba2f68e9d5dcc2bb67cc4c67.zip
Fix parser. Comments and IO_PORT
Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
Diffstat (limited to 'gowin/arch.cc')
-rw-r--r--gowin/arch.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/gowin/arch.cc b/gowin/arch.cc
index 8dc5657c..b4c8c96f 100644
--- a/gowin/arch.cc
+++ b/gowin/arch.cc
@@ -492,19 +492,17 @@ void Arch::read_cst(std::istream &in)
std::getline(in, line);
io_loc = true;
if (!std::regex_match(line, match, iobre)) {
- // empty line or comment
- if (line.empty() == 0) {
- continue;
- } else {
- if (!std::regex_match(line, match, portre)) {
- io_loc = false;
- } else if (line.rfind("//", 0) == 0) {
+ if (std::regex_match(line, match, portre)) {
+ io_loc = false;
+ } else {
+ if ( (!line.empty()) && (line.rfind("//", 0) == std::string::npos)) {
log_warning("Invalid constraint: %s\n", line.c_str());
- continue;
}
- }
- }
- // std::cout << match[1] << " " << match[2] << std::endl;
+ continue;
+ }
+ }
+
+ //std::cout << match[1] << " " << match[2] << std::endl;
IdString net = id(match[1]);
auto it = cells.find(net);