summaryrefslogtreecommitdiffstats
path: root/libtoprammer/main.py
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2012-04-14 17:39:41 +0200
committerMichael Buesch <m@bues.ch>2012-04-14 17:39:41 +0200
commitac2af484d0a61565864116afc3a9be47f16f5912 (patch)
tree8f4c511df854c8ad1fa7889cfba99ca1793c2221 /libtoprammer/main.py
parent1e00ee0dacff180d31e2fe60c46de61e32b45226 (diff)
downloadtoprammer-ac2af484d0a61565864116afc3a9be47f16f5912.tar.xz
toprammer-ac2af484d0a61565864116afc3a9be47f16f5912.zip
Add "ChipOption" mechanism
Signed-off-by: Michael Buesch <m@bues.ch>
Diffstat (limited to 'libtoprammer/main.py')
-rw-r--r--libtoprammer/main.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/libtoprammer/main.py b/libtoprammer/main.py
index d1a4f76..c2970c7 100644
--- a/libtoprammer/main.py
+++ b/libtoprammer/main.py
@@ -96,14 +96,21 @@ class TOP:
self.initializeProgrammer()
- def initializeChip(self, chipID):
+ def getProgrammerType(self):
+ "Returns the TYPE_TOPxxxx"
+ return self.topType
+
+ def initializeChip(self, chipID, assignedChipOptions=()):
"Initialize the programmer for a chip"
# If a chip is initialized, shut it down first.
if self.chip:
self.shutdownChip()
# Find the implementation of the chip.
- (descriptor, self.chip) = ChipDescription.findOne(self.topType, chipID, self.usebroken)
- self.chip.setTOP(self)
+ descriptor = ChipDescription.findOne(chipID, self.usebroken)
+ self.chip = descriptor.chipImplClass.createInstance(
+ top = self,
+ chipDescription = descriptor,
+ assignedChipOptions = assignedChipOptions)
# Find the bitfile for the chip.
bitfile = bitfileFind(descriptor.bitfile)
if not bitfile:
bues.ch cgit interface