File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 3
3
import argparse
4
4
import importlib
5
5
6
+ from amaranth .lib .wiring import Signature
7
+
6
8
from .hdl import Signal , Elaboratable
7
9
from .back import rtlil
8
10
@@ -68,11 +70,13 @@ def _serve_yosys(modules):
68
70
69
71
try :
70
72
elaboratable = modules [module_name ](* args , ** kwargs )
71
- ports = []
72
- # By convention, any public attribute that is a Signal is considered a port.
73
- for port_name , port in vars (elaboratable ).items ():
74
- if not port_name .startswith ("_" ) and isinstance (port , Signal ):
75
- ports += port ._lhs_signals ()
73
+ ports = None
74
+ if not (hasattr (elaboratable , "signature" ) and isinstance (elaboratable .signature , Signature )):
75
+ ports = []
76
+ # By convention, any public attribute that is a Signal is considered a port.
77
+ for port_name , port in vars (elaboratable ).items ():
78
+ if not port_name .startswith ("_" ) and isinstance (port , Signal ):
79
+ ports += port ._lhs_signals ()
76
80
rtlil_text = rtlil .convert (elaboratable , name = module_name , ports = ports )
77
81
response = {"frontend" : "ilang" , "source" : rtlil_text }
78
82
except Exception as error :
You can’t perform that action at this time.
0 commit comments