100mhz on the ao486 Core Now Stable? Maybe?

Blitzwing
Posts: 103
Joined: Sat Sep 05, 2020 9:52 pm
Has thanked: 11 times
Been thanked: 24 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by Blitzwing »

bbond007 wrote: Tue Nov 30, 2021 11:45 pm
Mr. Encyclopedia wrote: Tue Nov 30, 2021 11:42 pm My question is, how much of a performance improvement do you get going from 90Mhz to 100Mhz? I realize at these speeds every extra Mhz makes a difference, I'm just curious how much of a difference this can possibly be.
10%
Blitzwing wrote: Tue Nov 30, 2021 10:22 pm
Anyway the settings I was talking about are under... Assignments - Settings - (new box opens) - Compiler Settings - Advanced Settings (Fitter) - Fitter Aggressive Routability Optimizations set it to always.

Probably worth ignoring it for now as it is crashing for me now.

Edit. I also feel like the compile is taking much longer than I remember, do you know if there has been major changes to the core recently?
Did you try anything with Fitter Initial Placement Seed in that same settings menu? As 42 is the "Answer to the Ultimate Question of Life, the Universe, and Everything", maybe go with that?

It's possible that Fitter Aggress Routability Optimizations is slowing down the compile down?
Sorry you replied whilst I was typing out my previous post. Yea it probably is slowing the compile down quite a bit. The OC is working again, I'll change Fitter Initial Placement Seed with Fitter Aggressive Routability Optimizations set to "Never" seeing as I'm in a tinkering mood.

Plus "42" would make it all worth while if it worked :D
ToothbrushThreepwood
Posts: 90
Joined: Sun May 24, 2020 8:39 pm
Has thanked: 32 times
Been thanked: 32 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by ToothbrushThreepwood »

If the stability of the compiled 100MHz core is down thst chance at compilation time, won’t you have to get compile, test, recompile, test ad nauseum every time the core is updated?
FPGAzumSpass
Core Developer
Posts: 385
Joined: Sat May 23, 2020 12:55 pm
Has thanked: 42 times
Been thanked: 414 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by FPGAzumSpass »

Running at 100Mhz...you can compare it with overclocking your CPU.

The AO486 has stable timing at 50-60Mhz. That's what e.g. Intel would sell it at.
Now most boards can run it at 90Mhz.

Every build in Quartus with different seed is like buying a new CPU and trying it.
However: it's bound to your personal DE10-Nano!
Just because a build runs well for you, doesn't mean it will run well on some other board, as the FPGA is different.

It's basically a combination of the build timings and the FPGA silicon on your board.

So if you are really eager, you can most likely find a build that runs 100Mhz just for you.
I did this last year and it was super stable. Played Starcraft with it :)

But sharing this build is nearly worthless.
Neocaron
Top Contributor
Posts: 375
Joined: Sun Sep 27, 2020 10:16 am
Has thanked: 209 times
Been thanked: 87 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by Neocaron »

FPGAzumSpass wrote: Wed Dec 01, 2021 10:22 am Running at 100Mhz...you can compare it with overclocking your CPU.

The AO486 has stable timing at 50-60Mhz. That's what e.g. Intel would sell it at.
Now most boards can run it at 90Mhz.

Every build in Quartus with different seed is like buying a new CPU and trying it.
However: it's bound to your personal DE10-Nano!
Just because a build runs well for you, doesn't mean it will run well on some other board, as the FPGA is different.

It's basically a combination of the build timings and the FPGA silicon on your board.

So if you are really eager, you can most likely find a build that runs 100Mhz just for you.
I did this last year and it was super stable. Played Starcraft with it :)

But sharing this build is nearly worthless.
Yeah that's what I thought... still it would be cool to have an extra toggle for a 100mhz mode without tickering around at every update.
Now that I have my ao486 running at 100mhz stable I don't want to have to recompile it again for the next update :cry:

Plus since I know nothing about coding in general, even my hack to have it on is terrible, I had to remove the 15mhz mode.

Remastering Classic Game Cinematics: My new Youtube fun, check it out :D
https://www.youtube.com/@neocaron87

Blitzwing
Posts: 103
Joined: Sat Sep 05, 2020 9:52 pm
Has thanked: 11 times
Been thanked: 24 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by Blitzwing »

Neocaron wrote: Wed Dec 01, 2021 10:52 am
FPGAzumSpass wrote: Wed Dec 01, 2021 10:22 am Running at 100Mhz...you can compare it with overclocking your CPU.

The AO486 has stable timing at 50-60Mhz. That's what e.g. Intel would sell it at.
Now most boards can run it at 90Mhz.

Every build in Quartus with different seed is like buying a new CPU and trying it.
However: it's bound to your personal DE10-Nano!
Just because a build runs well for you, doesn't mean it will run well on some other board, as the FPGA is different.

It's basically a combination of the build timings and the FPGA silicon on your board.

So if you are really eager, you can most likely find a build that runs 100Mhz just for you.
I did this last year and it was super stable. Played Starcraft with it :)

But sharing this build is nearly worthless.
Plus since I know nothing about coding in general, even my hack to have it on is terrible, I had to remove the 15mhz mode.
Really. All I did was change this line

https://github.com/MiSTer-devel/ao486_M ... 86.sv#L239

From "h0P2O7,Overclock,Off,100Mhz;"

To "D2P2O7,Overclock,Off,100Mhz;"
User avatar
aberu
Core Developer
Posts: 1192
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 247 times
Been thanked: 411 times
Contact:

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by aberu »

Blitzwing wrote: Wed Dec 01, 2021 1:50 pm Really. All I did was change this line

https://github.com/MiSTer-devel/ao486_M ... 86.sv#L239

From "h0P2O7,Overclock,Off,100Mhz;"

To "D2P2O7,Overclock,Off,100Mhz;"
You can change seeding without doing this. Quartus allows you to manually set a seed value. You can also just add random whitespaces into the code before compiling to modify the randomness. Also what you did was change a hiding of an option with menumask to disabling the option with menumask. To be fair, it probably *should* disable it when it's set to off, so I'm not sure why it was set to h anyways.
birdybro~
Neocaron
Top Contributor
Posts: 375
Joined: Sun Sep 27, 2020 10:16 am
Has thanked: 209 times
Been thanked: 87 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by Neocaron »

aberu wrote: Wed Dec 01, 2021 2:50 pm
Blitzwing wrote: Wed Dec 01, 2021 1:50 pm Really. All I did was change this line

https://github.com/MiSTer-devel/ao486_M ... 86.sv#L239

From "h0P2O7,Overclock,Off,100Mhz;"

To "D2P2O7,Overclock,Off,100Mhz;"
You can change seeding without doing this. Quartus allows you to manually set a seed value. You can also just add random whitespaces into the code before compiling to modify the randomness. Also what you did was change a hiding of an option with menumask to disabling the option with menumask. To be fair, it probably *should* disable it when it's set to off, so I'm not sure why it was set to h anyways.
But since I could not find what any of those lines meant I couldn't do it this way and now that I know I will do it like that, so thanks ^^

Remastering Classic Game Cinematics: My new Youtube fun, check it out :D
https://www.youtube.com/@neocaron87

User avatar
aberu
Core Developer
Posts: 1192
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 247 times
Been thanked: 411 times
Contact:

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by aberu »

Neocaron wrote: Wed Dec 01, 2021 3:13 pm But since I could not find what any of those lines meant I couldn't do it this way and now that I know I will do it like that, so thanks ^^
https://github.com/MiSTer-devel/Main_Mi ... ion-string - here ya go! :)
birdybro~
Blitzwing
Posts: 103
Joined: Sat Sep 05, 2020 9:52 pm
Has thanked: 11 times
Been thanked: 24 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by Blitzwing »

aberu wrote: Wed Dec 01, 2021 2:50 pm
Blitzwing wrote: Wed Dec 01, 2021 1:50 pm Really. All I did was change this line

https://github.com/MiSTer-devel/ao486_M ... 86.sv#L239

From "h0P2O7,Overclock,Off,100Mhz;"

To "D2P2O7,Overclock,Off,100Mhz;"
You can change seeding without doing this. Quartus allows you to manually set a seed value. You can also just add random whitespaces into the code before compiling to modify the randomness. Also what you did was change a hiding of an option with menumask to disabling the option with menumask. To be fair, it probably *should* disable it when it's set to off, so I'm not sure why it was set to h anyways.
To be fair I have pretty much zero clue what I'm doing 🤣

I'm really just messing with stuff seeing what happens. I'd love to learn more but seeing as the year I spent learning C always felt a little above me, Verilog and VHDL feel even more so.
ToothbrushThreepwood
Posts: 90
Joined: Sun May 24, 2020 8:39 pm
Has thanked: 32 times
Been thanked: 32 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by ToothbrushThreepwood »

Just out of curiosity: can you compile a core with a higher clock than 100Mhz using this approach? Obviously it would be even more prone to instability, but why is 100Mhz and not 110Mhz the ceiling? Just a nice round number?
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by Caldor »

ToothbrushThreepwood wrote: Sun Jan 23, 2022 4:00 pm Just out of curiosity: can you compile a core with a higher clock than 100Mhz using this approach? Obviously it would be even more prone to instability, but why is 100Mhz and not 110Mhz the ceiling? Just a nice round number?
From what I understand its limited by the speed of the FPGA. Its also not really 100mhz, its just how the CPU sees itself, but its closer to the speed of a 33mhz 486. Varies a bit from test to test.
ToothbrushThreepwood
Posts: 90
Joined: Sun May 24, 2020 8:39 pm
Has thanked: 32 times
Been thanked: 32 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by ToothbrushThreepwood »

Caldor wrote: Sun Jan 23, 2022 7:08 pm
ToothbrushThreepwood wrote: Sun Jan 23, 2022 4:00 pm Just out of curiosity: can you compile a core with a higher clock than 100Mhz using this approach? Obviously it would be even more prone to instability, but why is 100Mhz and not 110Mhz the ceiling? Just a nice round number?
From what I understand its limited by the speed of the FPGA. Its also not really 100mhz, its just how the CPU sees itself, but its closer to the speed of a 33mhz 486. Varies a bit from test to test.
I understand that the register update speed/clock of the ao486 doesn’t translate 1-to-1 (or even 10-to-1 for many instructions) to a “real” 486. And the most likely answer to my question is that there’s a critical path somewhere in the CPU which Quartus can’t reliably build for an Fmax above 100 MHz. I just figured that some folks would have been trying their luck with seed spamming or other methods in Quartus to get every little bit of extra performance out of the CPU.
User avatar
Caldor
Top Contributor
Posts: 930
Joined: Sat Jul 25, 2020 11:20 am
Has thanked: 112 times
Been thanked: 111 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by Caldor »

ToothbrushThreepwood wrote: Sun Jan 23, 2022 9:11 pm
Caldor wrote: Sun Jan 23, 2022 7:08 pm
ToothbrushThreepwood wrote: Sun Jan 23, 2022 4:00 pm Just out of curiosity: can you compile a core with a higher clock than 100Mhz using this approach? Obviously it would be even more prone to instability, but why is 100Mhz and not 110Mhz the ceiling? Just a nice round number?
From what I understand its limited by the speed of the FPGA. Its also not really 100mhz, its just how the CPU sees itself, but its closer to the speed of a 33mhz 486. Varies a bit from test to test.
I understand that the register update speed/clock of the ao486 doesn’t translate 1-to-1 (or even 10-to-1 for many instructions) to a “real” 486. And the most likely answer to my question is that there’s a critical path somewhere in the CPU which Quartus can’t reliably build for an Fmax above 100 MHz. I just figured that some folks would have been trying their luck with seed spamming or other methods in Quartus to get every little bit of extra performance out of the CPU.
It should be possible to make it faster I think, but to make it faster you would probably need to make a new core from scratch, or at least that would probably end up making more sense than keeping focus on this core. This was an auto translation of an emulator to FPGA that was then later cleaned up manually and it had then level 1 and 2 cache added to the CPU. I do not remember what the source emulator was right now. But there are also other emulators to use as the basis I guess.
cursedverses
Posts: 180
Joined: Sun May 24, 2020 9:13 pm
Has thanked: 186 times
Been thanked: 34 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by cursedverses »

The source emulator was Bochs.
Coolbho3k
Posts: 60
Joined: Sat Feb 26, 2022 6:36 pm
Has thanked: 7 times
Been thanked: 61 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by Coolbho3k »

Has anyone tried just compiling the core targeting the 5CSEBA6U23C6 instead of the 5CSEBA6U23I7?
Coolbho3k
Posts: 60
Joined: Sat Feb 26, 2022 6:36 pm
Has thanked: 7 times
Been thanked: 61 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by Coolbho3k »

When compiling with Quartus Prime targeting the 5CSEBA6U23C6, I’m able to get ao486 to run the DOOM time demo on my board at 112.5 MHz, which is the only benchmark I had time to run. This is going to be "overclocking the FPGA" but it is, after all, all the same silicon with different bins.

112.5 MHz: timed 1667 gametics in 1682 realtics
100 MHz: timed 1667 gametics in 1892 realtics
90 MHz: timed 1667 gametics in 2092 realtics

RBF attached. To set to 112.5 MHz go into Hardware menu and enable Overclock.

I can post a branch with sources, but off ao486 master, literally all I did was change lines 451 and 452 in ao486.sv to:

Code: Select all

(* romstyle = "logic" *) wire [27:0] clk_rate[8]  = '{90000000, 15000000, 30000000, 56250000, 112500000, 112500000, 112500000, 112500000 };
(* romstyle = "logic" *) wire [17:0] speed_div[8] = '{  'h0505,   'h1e1e,   'h0f0f,   'h0808,   'h0404,   'h0404,   'h0404,   'h0404 };
And line 239 to:

Code: Select all

"D0P2O7,Overclock,Off,112Mhz;",
And in the Device menu choose the 5CSEBA6U23C6 (select Hierarchy in the Project Navigator and double click Cyclone V: 5CSEBA6U23I7 and change the target device to the 5CSEBA6U23C6).

This was the first compile attempt I made and I didn't attempt to play around with any seed stuff. The core locks up immediately at 112.5 MHz when targeting the 5CSEBA6U23I7 (the chip in DE10 Nano).
Attachments
clk.png
clk.png (2.35 KiB) Viewed 4664 times
c6.png
c6.png (83.12 KiB) Viewed 4664 times
ao486.rbf
(4.03 MiB) Downloaded 160 times
Coolbho3k
Posts: 60
Joined: Sat Feb 26, 2022 6:36 pm
Has thanked: 7 times
Been thanked: 61 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by Coolbho3k »

So, more stability testing on the above. A few DOS games worked fine, and Windows 95 installed just fine at 112.5 MHz for me… but in the OS itself immediately it gives me a windows protection error!

So it's not quite stable on my board. I think the best we can hope for in compiling with -C6 is maybe it'll make 100 MHz work for some more boards.
Neocaron
Top Contributor
Posts: 375
Joined: Sun Sep 27, 2020 10:16 am
Has thanked: 209 times
Been thanked: 87 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by Neocaron »

Coolbho3k wrote: Wed Mar 30, 2022 8:38 pm So, more stability testing on the above. A few DOS games worked fine, and Windows 95 installed just fine at 112.5 MHz for me… but in the OS itself immediately it gives me a windows protection error!

So it's not quite stable on my board. I think the best we can hope for in compiling with -C6 is maybe it'll make 100 MHz work for some more boards.
I haven't tried your build yet, but I'm curious to see if it would be stable on my board :mrgreen:
I'm out of town for a couple of weeks, so I can't test it. I'm sure 110mhz would make some of my mid 90s favorite game on windows 98 and dos run quite a bit better ^^
100mhz never crashed on my board despite pushing it extra hard. So yeah looking forward to try this out. Thanks for experimenting on this! Is it possible to try 110, 108, 107 etc... until it's stable for you?

Remastering Classic Game Cinematics: My new Youtube fun, check it out :D
https://www.youtube.com/@neocaron87

Coolbho3k
Posts: 60
Joined: Sat Feb 26, 2022 6:36 pm
Has thanked: 7 times
Been thanked: 61 times

Re: 100mhz on the ao486 Core Now Stable? Maybe?

Unread post by Coolbho3k »

Neocaron wrote: Wed Mar 30, 2022 11:59 pm
Coolbho3k wrote: Wed Mar 30, 2022 8:38 pm So, more stability testing on the above. A few DOS games worked fine, and Windows 95 installed just fine at 112.5 MHz for me… but in the OS itself immediately it gives me a windows protection error!

So it's not quite stable on my board. I think the best we can hope for in compiling with -C6 is maybe it'll make 100 MHz work for some more boards.
I haven't tried your build yet, but I'm curious to see if it would be stable on my board :mrgreen:
I'm out of town for a couple of weeks, so I can't test it. I'm sure 110mhz would make some of my mid 90s favorite game on windows 98 and dos run quite a bit better ^^
100mhz never crashed on my board despite pushing it extra hard. So yeah looking forward to try this out. Thanks for experimenting on this! Is it possible to try 110, 108, 107 etc... until it's stable for you?
As far as I know the only valid values right now are 100, 112.5, 128.571328, 150... Because of how the PLL is set up.
Post Reply