1
1
import os , subprocess , sys
2
2
3
3
from migen .fhdl .std import *
4
- from migen .fhdl .specials import SynthesisDirective
5
- from migen .genlib .cdc import *
6
4
from migen .fhdl .structure import _Fragment
7
5
8
6
from mibuild .generic_platform import *
9
- from mibuild import tools , xilinx_tools
7
+ from mibuild import tools , xilinx_common
10
8
11
9
def _format_constraint (c ):
12
10
if isinstance (c , Pins ):
@@ -94,7 +92,7 @@ def _run_ise(build_name, ise_path, source, mode, ngdbuild_opt,
94
92
source = False
95
93
build_script_contents = "# Autogenerated by mibuild\n set -e\n "
96
94
if source :
97
- settings = xilinx_tools .settings (ise_path , ver , "ISE_DS" )
95
+ settings = xilinx_common .settings (ise_path , ver , "ISE_DS" )
98
96
build_script_contents += "source " + settings + "\n "
99
97
if mode == "edif" :
100
98
ext = "edif"
@@ -121,28 +119,7 @@ def _run_ise(build_name, ise_path, source, mode, ngdbuild_opt,
121
119
if r != 0 :
122
120
raise OSError ("Subprocess failed" )
123
121
124
- class XilinxNoRetimingImpl (Module ):
125
- def __init__ (self , reg ):
126
- self .specials += SynthesisDirective ("attribute register_balancing of {r} is no" , r = reg )
127
-
128
- class XilinxNoRetiming :
129
- @staticmethod
130
- def lower (dr ):
131
- return XilinxNoRetimingImpl (dr .reg )
132
-
133
- class XilinxMultiRegImpl (MultiRegImpl ):
134
- def __init__ (self , * args , ** kwargs ):
135
- MultiRegImpl .__init__ (self , * args , ** kwargs )
136
- self .specials += [SynthesisDirective ("attribute shreg_extract of {r} is no" , r = r )
137
- for r in self .regs ]
138
-
139
- class XilinxMultiReg :
140
- @staticmethod
141
- def lower (dr ):
142
- return XilinxMultiRegImpl (dr .i , dr .o , dr .odomain , dr .n )
143
-
144
- class XilinxISEPlatform (GenericPlatform ):
145
- bitstream_ext = ".bit"
122
+ class XilinxISEPlatform (xilinx_common .XilinxGenericPlatform ):
146
123
xst_opt = """-ifmt MIXED
147
124
-opt_mode SPEED
148
125
-register_balancing yes"""
@@ -151,16 +128,6 @@ class XilinxISEPlatform(GenericPlatform):
151
128
ngdbuild_opt = ""
152
129
bitgen_opt = "-g LCK_cycle:6 -g Binary:Yes -w"
153
130
ise_commands = ""
154
- def get_verilog (self , * args , special_overrides = dict (), ** kwargs ):
155
- so = {
156
- NoRetiming : XilinxNoRetiming ,
157
- MultiReg : XilinxMultiReg
158
- }
159
- so .update (special_overrides )
160
- return GenericPlatform .get_verilog (self , * args , special_overrides = so , ** kwargs )
161
-
162
- def get_edif (self , fragment , ** kwargs ):
163
- return GenericPlatform .get_edif (self , fragment , "UNISIMS" , "Xilinx" , self .device , ** kwargs )
164
131
165
132
def build (self , fragment , build_dir = "build" , build_name = "top" ,
166
133
ise_path = "/opt/Xilinx" , source = True , run = True , mode = "xst" ):
0 commit comments