From ac2af484d0a61565864116afc3a9be47f16f5912 Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Sat, 14 Apr 2012 17:39:41 +0200 Subject: Add "ChipOption" mechanism Signed-off-by: Michael Buesch --- libtoprammer/main.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'libtoprammer/main.py') 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: -- cgit v1.2.3