-
Notifications
You must be signed in to change notification settings - Fork 22
/
__init__.py
61 lines (45 loc) · 1.23 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
try:
from functools import lru_cache
except ImportError:
from backports.functools_lru_cache import lru_cache
cachedFunctions = []
def clear_cachedFunctions():
for func in cachedFunctions:
func.cache_clear()
def cache_definition(fn):
cachedFunctions.append(lru_cache(maxsize=None)(fn))
return cachedFunctions[-1]
# wires
from .port import *
from .wire import *
# types
from .t import *
from .bit import *
from .array import *
from .bits import *
# Define default operators that raise exceptions, rename so it doesn't muck
# with `from magma import *` code that also uses operator
import magma.operators
from .tuple import *
from .clock import *
from .conversions import *
from .interface import *
# circuit
from .circuit import *
# higher-order operators
from .braid import *
# verilog
from .fromverilog import *
from .backend.verilog import *
# compile
from .compile import *
from .logging import warning
mantle_target = None
def set_mantle_target(t):
global mantle_target
if mantle_target is not None and mantle_target != t:
warning('changing mantle target', mantle_target, t )
mantle_target = t
from .backend.util import set_codegen_debug_info
from .enum import Enum
import magma.util