New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include PLL example in Blinky #1
Comments
@vstrakh I've added a branch |
The PLL may not be working on the hardware yet – this is why I've left it in a branch instead of merging into master. Looking at
|
The PLL is definitely being enabled in the bitstream. Using agm-unpack and agm-explain, the existing blinky example has:
Whereas this new blinky-pll has:
|
I see. I didn't know about 'place_pseudo' tcl command. The af help didn't list it. It seems that the gnd at the global clock input comes from earlier stages. The file alta_db/flatten.vx has implicitly inserted cycloneive_clkctrl instance which looks totally wrong. Not only it puts the clocks into seemingly wrong order, selecting the gnd for output, it has ena control input grounded too, so at the filtering stage p&r had no options but to ground the clock input. Even if PLL is running, the global clock net will be grounded...
|
Hmm... |
Awesome! Cursory test works on my dev board – although it works without any input to the PLL's
Thank you for figuring this out! |
Some chinese pdf I've seen tells that pll might work on its own ("saving the crystal") when it is configured with It's good it is running, and it would be great if you'd confirm the feedback input behavior, checking the looping options (source clk, own clkout with different dividers, etc), and checking the resulting frequency. I have a device that needs fpga part bugs fixed, the manufacturing company didn't fixed it for a year, and doesn't tell the time plan for that fix. Since there are no convenient interfaces, any test requires firmware rebuilding and re-flashing the core stm32 chip, and I'd like to avoid the excess experimental writes, to have the device alive for its actual function after I finish new fpga design prototype in some external MAX10/Spartan board :) |
Probably there's no need in testing feedback input behavior. The overall dividers picture looks consistent with |
IO stuff is 100% wrong. I believe logic, wires and pips might be okay. Output from a nextpnr session: + nextpnr-generic --pre-pack simple.py --pre-place simple_timing.py --json blinky.json --post-route bitstream.py --write pnrblinky.json Creating Basic Elements Creating PIPs and Wires for BramTILE ... created 59502 PIPs Creating PIPs and Wires for IOTILE ... created 12612 PIPs Creating PIPs and Wires for LogicTILE ... created 325280 PIPs Creating PIPs and Wires for RogicTILE ... created 16800 PIPs Info: Packing constants.. Info: Packing IOs.. Info: Packing LUT-FFs.. Info: Packing non-LUT FFs.. Info: Checksum: 0xc92363f0 Info: Annotating ports with timing budgets for target frequency 12.00 MHz Info: Checksum: 0xc92363f0 Info: Device utilisation: Info: GENERIC_IOB: 9/ 84 10% Info: GENERIC_SLICE: 36/ 1280 2% Info: GENERIC_BRAM: 0/ 15 0% Info: GENERIC_ROUTE: 0/ 8 0% Info: Placed 9 cells based on constraints. Info: Creating initial analytic placement for 34 cells, random placement wirelen = 424. Info: at initial placer iter 0, wirelen = 45 Info: at initial placer iter 1, wirelen = 44 Info: at initial placer iter 2, wirelen = 26 Info: at initial placer iter 3, wirelen = 45 Info: Running main analytical placer. Info: at iteration #1, type GENERIC_SLICE: wirelen solved = 46, spread = 59, legal = 111; time = 0.00s Info: at iteration #2, type GENERIC_SLICE: wirelen solved = 15, spread = 35, legal = 69; time = 0.00s Info: at iteration #3, type GENERIC_SLICE: wirelen solved = 21, spread = 26, legal = 60; time = 0.00s Info: at iteration #4, type GENERIC_SLICE: wirelen solved = 19, spread = 37, legal = 72; time = 0.00s Info: at iteration #5, type GENERIC_SLICE: wirelen solved = 22, spread = 52, legal = 62; time = 0.00s Info: at iteration #6, type GENERIC_SLICE: wirelen solved = 28, spread = 33, legal = 48; time = 0.00s Info: at iteration #7, type GENERIC_SLICE: wirelen solved = 25, spread = 31, legal = 71; time = 0.00s Info: at iteration #8, type GENERIC_SLICE: wirelen solved = 25, spread = 45, legal = 82; time = 0.00s Info: at iteration #9, type GENERIC_SLICE: wirelen solved = 45, spread = 42, legal = 79; time = 0.00s Info: at iteration #10, type GENERIC_SLICE: wirelen solved = 37, spread = 37, legal = 70; time = 0.00s Info: at iteration #11, type GENERIC_SLICE: wirelen solved = 47, spread = 45, legal = 74; time = 0.00s Info: HeAP Placer Time: 0.02s Info: of which solving equations: 0.01s Info: of which spreading cells: 0.00s Info: of which strict legalisation: 0.00s Info: Running simulated annealing placer for refinement. Info: at iteration #1: temp = 0.000000, timing cost = 0, wirelen = 48 Info: at iteration #5: temp = 0.000000, timing cost = 0, wirelen = 38 Info: at iteration #5: temp = 0.000000, timing cost = 0, wirelen = 38 Info: SA placement time 0.01s Warning: No clocks found in design Info: Checksum: 0xbbb1d3cb Info: Routing.. Info: Setting up routing queue. Info: Routing 141 arcs. Info: | (re-)routed arcs | delta | remaining| time spent | Info: IterCnt | w/ripup wo/ripup | w/r wo/r | arcs| batch(sec) total(sec)| Warning: Failed to find a route for arc 4 of net ctr[22]. ERROR: Routing design failed. 2 warnings, 1 error
I'm happy I can finally start playing with the AG1KLP chip using your examples as a basis.
But there's one thing that darkens my day. It seems I can't make AF place&route designs with PLL instantiated. Yosys does its job, but AF then either crashes with exception (alternatively sefgaults), or stops, telling that "Slice pll|clkout0~ALTA_GCLK is not yet packed, ignored for placement".
I understand there must be some tech-related strict requirements on global clock nets and pll outputs handling, so the Yosys and AF must include required primitives (alta_gcksel, etc). But when I naively add alta_io_gclk buffer to the PLL output in my sources, I get AF failing to read DB design in place&route, because it did produce intermediate files with syntax errors "unexpected '(', expecting ID at ./output/alta_db/filtered.vx" where it inserted unnamed instance of alta_io_gclk after the alta_gclksel.
I hope you can shed some light on the issue, and include the example of valid PLL instantiation with Yosys, conforming to the chip's requirements. I did try suggested workflow with Quartus, but it seems it's not possible with free Quartus Lite Edition, which doesn't support the design partitions.
The text was updated successfully, but these errors were encountered: