Skip to content

Commit

Permalink
Use digital instead of explicit types
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardt committed Nov 20, 2019
1 parent 8100f3d commit 97f9f01
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions magma/backend/coreir_.py
Expand Up @@ -4,6 +4,7 @@
import magma as m
from ..wire import Wire
from ..bit import Bit, BitIn, BitOut
from ..digital import Digital
from ..array import Array
from ..tuple import Tuple, Product
from ..clock import wiredefaultclock, wireclock, Clock, Enable, Reset, \
Expand Down Expand Up @@ -113,12 +114,12 @@ def check_type(port, errorMessage=""):
elif issubclass(port.type_, Tuple):
for (k, t) in port._get_items():
check_type(t, errorMessage.format("Tuple({}:{})".format(k, "{}")))
elif issubclass(port.type_, (Bit, Clock, Enable, Reset, AsyncReset, ResetN, AsyncResetN)):
elif issubclass(port.type_, Digital):
return
else:
raise CoreIRBackendError(errorMessage.format(str(port)))
for name, port in definition.interface.ports.items():
check_type(port, 'Error: Argument {} must be comprised only of Bit, Array, or Tuple')
check_type(port, 'Error: Argument {} must be comprised only of Digital, Array, or Tuple')

def get_type(self, port):
if issubclass(port.type_, Array):
Expand Down

0 comments on commit 97f9f01

Please sign in to comment.