Ajstros / pyripherals

Python solution for communicating with peripheral ICs
GNU General Public License v3.0
2 stars 3 forks source link

DDR3 Requires Instantiation to use parameters #6

Open Ajstros opened 2 years ago

Ajstros commented 2 years ago

Some values in the DDR3 parameters attribute are useful outside of the DDR3, such as "update_period" and "sample_size". These are currently assigned only when the DDR3 is instantiated. Additionally, the DDR3 instantiation requires an FPGA instance, and that instance must have run FPGA.init_device already to get the xem attribute. I believe that is from line 80:

self.clear_adc_debug()

The biggest concern is having to run FPGA.init_device since we don't always have an FPGA connected when we need "parameters" values. (e.g. setting up data for DDR and needing "update_period" and "sample_size" to do so).

I think this can be solved by making parameters a class attribute instead of an instance attribute. While this change is being made, it also makes sense to take the values out of parameters, making them separate attributes of the class. This will allow autocomplete and better syntax highlighting in editors.