aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorazidar2015-08-04 12:32:45 -0700
committerazidar2015-08-04 12:32:45 -0700
commit45a54fadf735742b819590f3209224636e56c715 (patch)
tree025d0b33f7e1455d25adbffc2ec7c419e1a2053a /src
parentff6dfecf42560ed2e2eb678adc9ca8d868a472bd (diff)
Fixed reading from instance's input ports. Fixed unique naming bug.
Diffstat (limited to 'src')
-rw-r--r--src/main/stanza/errors.stanza3
-rw-r--r--src/main/stanza/ir-utils.stanza6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/main/stanza/errors.stanza b/src/main/stanza/errors.stanza
index 5212bcb5..edb9928e 100644
--- a/src/main/stanza/errors.stanza
+++ b/src/main/stanza/errors.stanza
@@ -735,7 +735,7 @@ public defn check-genders (c:Circuit) -> Circuit :
[MALE, FEMALE] :
add(errors,WrongGender(info,to-symbol(e),as-srcsnk(desired),as-srcsnk(gender)))
[FEMALE, MALE] :
- if kind* != PortKind() :
+ if kind* != PortKind() and kind* != InstanceKind():
add(errors,WrongGender(info,to-symbol(e),as-srcsnk(desired),as-srcsnk(gender)))
else : false
@@ -801,7 +801,6 @@ public defn check-genders (c:Circuit) -> Circuit :
match(m) :
(m:ExModule) : false
(m:InModule) : check-genders-s(body(m),genders)
- println(genders)
throw(PassExceptions(errors)) when not empty?(errors)
c
diff --git a/src/main/stanza/ir-utils.stanza b/src/main/stanza/ir-utils.stanza
index 2fb92407..8cfd1541 100644
--- a/src/main/stanza/ir-utils.stanza
+++ b/src/main/stanza/ir-utils.stanza
@@ -67,7 +67,11 @@ public defn get-sym-hash (m:InModule,keywords:List<Symbol>) -> HashTable<Symbol,
s*[i] == '_' and digits?(substring(s*,i + 1))
match(i*) :
(i:False) :
- sym-hash[s] = 0
+ if key?(sym-hash,s) :
+ val num = sym-hash[s]
+ sym-hash[s] = max(num,0)
+ else :
+ sym-hash[s] = 0
(i:Int) :
val name = to-symbol(substring(s*,0,i))
val digit = to-int(substring(s*,i + 1))