Andrey_Filippov
Andrey_Filippov on Hacker News
I think Obama should not just pardon Snowden, but nominate him to a position of NSA director.
Snowden is both a top professional and cares about our rights and freedoms. NSA is still needed (in some form) in the real world, and I would definitely feel safer if Snowden was at its controls.
Yes, I'm guilty in DRY violation and I mentioned it in the post - I still manually translate Verilog to Python when go from simulation/debugging to hardware testing/debugging. And we are looking to use a more productive way to do this - write the simulation code (that replaces the CPU activity of the real hardware) in the programming language (Python) rather than switching to System Verilog that is somewhat in between the hardware description language and a software programming one. That is in our future plans, not there yet.
Other than that - DRY is always in our agenda, and there is only one place that holds the parameters/ preprocessor macros that define the hardware and its software interface. Python code reads Verilog files and extracts all the parameter names and values (names/types are automatically added to the Python source to allow checking). That Python code allows to run tests on the target system, do some calibration and save results in the same Verilog parameters format (same as here https://github.com/Elphel/x393/blob/master/includes/x393_cur... , just no header). Same program uses Verilog data to export C files, it uses hand-crafted code to allow flexibility - it is not always possible to fit everything in the same format, but here the focus is again on the DRY - new code to do what is different, and use common code that processes multiple data items as much as possible. And when it is not - provide checks to catch differences when you do have to repeat yourself.
Only part of the Python code is a "translation" of the Verilog tests (and this we plan to eliminate in the future), the rest is just a continuation of the project, and when writing (not just running) that code I'm re-using data exported from the Verilog (and re-exported when there are changes that influence data). Same with C - code continues the project, re-using Verilog+Python data.
Yes, you are absolutely right about "repeatedly solved problems", so it is definitly one in the series of "yet another ...". I'll try your program on our project files to see what registers it can extract from it. I'm assuming that there is no perfect universal solution, and I agree that Verilog-to-C (just having C in the back of your mind while working on the FPGA) is better here than C-to-Verilog. So in our case there is no automatic generator, code just helps you to avoid errors. Python program imports Verilog parameters/localparams (just constants and the the ones derived from them using expressions) and catches most of the typos when I write the generator code (not dramatically shorter than what it generates). This allows me to be flexible - the instantiated modules are not very uniform and not all have exactly the same interface - many were developed a long time ago starting as early as 2002. Not many are that old, but there are still many interface variations, and I do not mind going once more through them before switching to the C work from Verilog. I want just two things:
- reduce the number of possible errors as a result of the manual translation and
- make this (somewhat hand-crafted) converter be able to synchronize future changes in Verilog code to the C code that uses it, so five years from now it will be easy to add functionality to the system.
And thanks again for the links - I'll look more into your code.
Scott, you are right, and I try to do it that way (there are many registers in the design with "_ram" suffix. But I did have some problems when Vivado incorrectly inferred small non-registered RAM as Block RAM.
I was able to modify the design (moving registers from inputs to outputs - https://github.com/Elphel/x393/blob/master/x393_sata/host/el... ) to force Vivado to infer correctly, but still have suspicion that it may not always be the case. So I used wrapper modules for Block RAMS with direct instances, they can be replaced as you suggested.
Thank you, at leas one of "these people" got it. Interesting project, but again - it is still far performance-wise. We really appreciate work of developers of the Free Software toolchain, but we work in a slightly different area as we need much larger devices. Yes, we use proprietary tools (with some limitations described in the original post). These tools are physically isolated from my workstation - they are held a "jail" - a separate Linux box controlled from the IDE on a Free Software -only workstation. Icarus/GtkWave are launched locally, but ISE/Vivado(tcl console)/Quartus - over ssh+rsync.
What objections do you have to the requirements to release documentation? Similar anti-monopoly laws already exist in other areas.
It would make Clifford's job much easier (so you will benefit too), don't you think?
No single dominating block. Camera has 4 sensor channels (now either 12 bit parallel or Aptina HiSPI) with gamma and histograms, 16-channel DDR3 controller, 4 compressor channels, inter-camera synchronization and high-speed IMU logger. And AHCI SATA2 controller (with provisions to be later upgraded to SATA3). The last module uses 6%, others share other 78% slices. As most of them have 4 identical instances, it makes about 10% each. Years ago one similar channel (1 sensor, 1 compressor, slower clocks) was implemented on Spartan-3e.
Project uses 84% of Zynq (7030), it will not fit in Lattice :-(
Not really many are "analog" and we already have GTX model. Some primitives are just buffers, some - memories (block RAM), one PLL. I do not think it is a "rocket science" to create functional models without precise timing.
As for different architectures - sure these will not work, but we keep all the primitives in "wrapper" modules to simplify porting. With missing primitives it will be possible to run complete simulation, after that you can start replacing primitives to match different devices.