Project to create an ATX 80286 mainboard based on the IBM 5170

These projects document the reverse engineering and CPLD or FPGA based recreation of historic computer systems such as the IBM 5170 PC/AT and the Compaq Deskpro Model 40, preserving original system behavior using modern hardware.
rodneykn
Site Admin
Posts: 26
Joined: Wed Jul 29, 2026 11:56 pm

Re: Project to create an ATX 80286 mainboard based on the IBM 5170

Post by rodneykn »

So after my recent findings to further improve the PC/AT system controller derived from the original IBM 5170 technology, I am currently looking into a follow up REV2C system design. Since the completely revised system controller design is also applicable in the PLCC/TTL based design iteration, this also brought me on the path to look into how I could even further optimize the usage of the CPLDs to help form a PC/AT system, where we make use of CPLDs assisted by TTL bus logic to achieve an alternative system design.

The new design will have the following features and specifications:
- 3 84 pin PLCC CPLDs will be used
- a lot of bus logic will be handled by TTL ICs
- the design will feature onboard 1MByte SRAMs
- system address bus will be generated by CPLDs.
- possibly I will include an EMS system supporting RealDOOM by making use of TTL bus and mux components to support the same two page register SRAMs as the REV3E system
- if successful, the XMS/EMS RAM will be flexible for dual usage, same as the REV3E system

The CPLDs will be named:
- Address bus driver CPLD
This CPLD will generate all chip selects including EMS and drives the highest system address lines.
- IO decoder CPLD
This CPLD does all IO decoding and controls enabling of the EMS system by the driver. In addition it drives the lower system address lines.
- System controller CPLD
This CPLD does cycle control, generates the dynamic 80286 clock, generates the SA0 and SBHE signals for byte control, outputs the commands and merges these with DMA command inputs.

So here I will look into whether we could still feature an EMS system using regular logic to provide access to the page register SRAMs, and switch between XMS and EMS operation of the combined SRAM footprints.

I have completed the Address bus driver CPLD design where due to pin shortage I will make use of external mid DMA address latches, then combined and connected with the CPU side of the address bus, and we will make use of the CPU being in HOLD status to be able to apply the mid DMA address section to the address bus driver inputs. So the Address bus driver CPLD will handle all memory decoding in one chip, and we don't feature a separate EMS controller. Part of the EMS controller functions will be handled by TTL chips in that scenario. So I am looking into whether that would be reasonably feasible to do it that way.

Next I will work on the REV2C IO decoder design which will do some additional decoding for the EMS enable and control signals. I still will need to see whether I can have enough pins available for this. The idea is to also generate a portion of the lower system address bus with the IO decoder. Together the two CPLDs can handle the entire system address bus, at least, in the best way as this could be achieved with the limited small CPLDs. When the DMACs drive the lower system address lines, the IO decoder CPLD will release the bus during DMA, so basically the IO decoder can be viewed as a CPU-only component. In the Address bus driver, at the edges of the shifted aligned bus control between DMAC-1 and DMAC-2, the Address bus driver handles the separated sources where otherwise we would have a bus conflict in certain cases. Here I will also attempt to use the ungated 286_A20 line to drive the LA20 signal on the slot. I have previously done tests and the VGA controller supports that without issues. Of course, such a system will only function when the system RAM is not on the slot, which in our modern design is always the case since we are not using memory boards that cross the 1MB boundary on the slots. I could even do tests whether it's possible to POST the system with /MEMW and /MEMR only since more advanced VGA controllers like the Cirrus Logic will observe all the highest address lines to decode the full address locations.

I am also going to do some testing with the REV2C hand wired build to see whether we can make do without the LAxx address transceiver. Theoretically when the CPU and DMA page mapper don't drive the CPU address bus and go into tri-state, we can then let a ISA bus master drive those lines from the slot and we can decode them inside the address bus driver CPLD for driving the system SRAMs during bus master cycles. In effect, the transceiver is used for buffering the CPU address lines A17-A23 however since there are not so many cards on these high memory address lines anyway, in fact in most cases only the VGA controller itself, we can then simply let the 80286 CPU drive the lines directly. Basically I am doing the same in the REV4 QFP FPGA design. The QFP is severly limited in pins so we will need to use some reductions to be able to make the design work.

I have zero budget so if you want to sponsor some parts and/or help me pay for PCB production, please get in touch with me. In the future we may be better off using more modern FPGAs if CPLD prices are increased.

I am not sure after the REV2C designs are finished what I am going to do next. I still need to rework the REV4 FPGA design and build up the board. Next I may focus on a 80486 design that largely works on 3.3V logic. The 80486 does a lot of internal byte path handling so this doesn't need to happen externally in the system, which simplifies the design somewhat.

Kind regards,

Rodney
rodneykn
Site Admin
Posts: 26
Joined: Wed Jul 29, 2026 11:56 pm

Re: Project to create an ATX 80286 mainboard based on the IBM 5170

Post by rodneykn »

I have previously done some testing on the REV3E system and this led me to believe that this system may be capable of running at higher clock speeds.

Since we now have a System controller CPLD design which is fully synchronous by using double the 286_CLK clock frequency on the CPLD clock input, this opens up a path to start testing at 80286 operational frequencies above 20MHz in this design model. So far, I have verified the system by using a 80MHz oscillator which works perfectly and completely stable.

We can find some 100MHz oscillators, for example, on the market however this will still present a limited test opportunity so I have decided to go the path of wanting to use a variable oscillator. I have done some experimentation using a transistor oscillator that uses a tunable LC tank circuit however my experiences varied in terms of the oscillation range, because here a lot of RF frequency factors are affecting the circuit operation. So this path would require me to manufacture some type of solderable PCB where I can add or remove components from several solder points, and for example the bottom layer would then be all ground plane. So that type of PCB is more RF compatible and will not offer so many stray capacitance etc. Anyway that is one way, however after some consideration, I have decided to go with a microcontroller setup that controls a SI5351A clock generator Adafruit module.

I have some ATMega328P chips in my parts box and my Galep-III programmer can directly program those, so I will do something along these lines:

- Adafruit SI5351A module connected directly to the oscillator pinout shape like a socket or something
- ATMega328P controller
- SSD1306 display module to output the frequency information
- a few buttons for up and down, and setting the increment size step
- serial debugging interface that drives a PC terminal

So the SI5351A module will be directly connected to the REV3E mainboard, and we feature a small I2C cable to the ATMega328P board, where we can press the buttons to set the test frequency and test the system to find the exact clock ranges. Later I will make some changes so we an enter a frequency directly in a PC terminal window, and we may wire a RESET connection so we can RESET the system automatically after each new frequency being set.

This idea will allow me a much wider range of test capability where I can also test the lower clock regions. Just to see which values are 100% stable for operation. It will be interesting to test the system at very low clock frequencies, and at the highest of course.

If this works well, I may feature the SI5351A as a board option if someone wants to build such a system. The connected ATMega328P can be easily added on a mainboard design where you can plug a PC terminal, or connect some buttons, etc to make the system fully flexible in terms of the frequency range. The display and some buttons can be possibly added to the front panel of the PC case. Software could be made to each time RESET the system after updating the clock frequency, and in the software programmed into the ATMega328P, we can set a base clock frequency to initialize by default. If we could update the SI5351A within the 2 second RESET pulse duration, this may even initialize the system transparently without even needing to issue another RESET pulse. So if we can vary the clock speed with high resolution, this should allow us to detemine the absolute clock limits of the REV3E, and possibly later on in a REV2C edition design if there would be some interest for that.

I am working with google AI to put this solution together and I will test the programming it provides. It will surely save me a lot of time by extracting the exact information I need without needing to go through example code, modify and test and experiment etc., which is of course cool to go through these steps myself, however it will be very time consuming, same as using the transistor oscillator, with enough time and experimentation that also should work out fine. However I just want to find a suitable quick solution that suits the needs for doing overclock range testing. If this all works out, I can think about how to add this as an option to certain designs, especially those systems that don't have a FPGA yet where you could reprogram the FPGA PLL to modify the clock speeds. So for the REV4 system we will hopefully have an easier time to modify the 80286 clock speed.

Come to think of it, on a possible board design where we feature an ATMega328P or similar controller anyway, I could also use that controller for doing other tasks such as resetting the system, possibly powering it on 5V standby power and letting the controller also respond to the power button, and possibly output other information on the display. Maybe we could use software to write to the controller, let it translate the POST codes to the front panel, and after POST finishes, writing other status information about the system to the display via port 80h.

Possibly if the work with this little controller chip goes well, I could make more elaborate use of the thing in the future. On the REV3E, we have 4 spare pins on the IO decoder CPLD directly on a header, and we also have the display output pins which we could double as a I/O port to the little controller for the system to interface directly to it. This could be used for all sorts of experimental stuff like maybe write a frequency update value to a IO port and RESET the system to initialize that frequency. If you have some software that needs to run slowly, this could enable some custom clocking features. A simple executable program could update the clock speed to any value and then RESET the system automatically.

Kind regards,

Rodney
rodneykn
Site Admin
Posts: 26
Joined: Wed Jul 29, 2026 11:56 pm

Re: Project to create an ATX 80286 mainboard based on the IBM 5170

Post by rodneykn »

After doing a lot of soldering on the REV4 QFP mainboard, I want to document the process of building the REV4 QFP system here.
I more in depth description of my process can provide a builder with a few guidelines regarding the order of assembling and testing the mainboard.

So I first soldered all the 0402 capacitors on the bottom of the board, then I soldered the 3 regulators in place. Also wait with the two power diodes until the SMD capacitors around them are in place. Then the work is not so hampered with the iron. The components are tightly spaced in the design because this is electrically the most optimal situation. Practically for soldering this requires a little strategy what to do first.

In the initial batch of components to be soldered, I also added the 32MHz oscillator for the FPGA.

I have a warning regarding the XC6706 regulator used for the 4V power net.
This regulator is apparently not very well resistant against soldering heat at all.
I apparently managed to kill the first one only by soldering it, and got 0V on the output.
So I removed the regulator and cleaned off the solder from the board.
After replacing it, I got the 4V net up.
It's my advice to first solder the input and output capacitors that are next to the XC6706 regulator, then position the regulator and very briefly solder the input and output pins on their pads. The ground in the middle you can leave loose, and instead you can again briefly solder the tab to the ground pad underneath. So the shorter with the iron, the better. I would suggest adding flux so the solder on the pins flows quickly so the tiny regulator can cool down faster. So it's not a good idea to spend more time to flow the solder underneath the whole ground surface of the regulator, that may be too harsh for it.

So after soldering the three regulators, I proceeded to solder all bottom SMD components. Then I proceeded to add the standby power LED, the ATX power on RESET ICs, the ATX power connector, and a few capacitors next to it. Also the power, reset, speaker, power LED pinheaders are useful for connecting a switch and power LED.

I have also soldered the top clock generator ICs and passive components for these including the crystals.
So the whole idea is that you can plug in the ATX connector, power up the board using a pushbutton switch power cable, and monitor the ATX power with a power LED on a short lead. The Standby LED can signal when the ATX PSU is connected and switched on, which applies standby power.

In addition, in the first batch of soldering, I also soldered the 208 pin Altera MAX7000S CPLD onto the board, and added the JTAG pinheader.

So I proceeded to power on the board in a safe place on the table, and you can take a multimeter in voltage mode, hold the ground pin on GND, and then after powering on the mainboard, you can check inside all capacitor footprints what voltage that footprint should carry, and check all of them with the multimeter. So if the capacitor footprint is marked "3V3", you should measure 3,3V there, etc.
This way, I found the 4V missing and replaced the regulator as described. The only thing you can't find on normal capacitor footprint is the analog PLL power voltage, so you can carefully turn around the mainboard and measure directly on the regulator itself. So both the core and PLL voltages should all be 1,2 Volt.

Next test can be after verification that all the power voltages are correct, to connect the USB blaster with the special cable to the CPLD pinheader in the correct orientation, and you can power on the mainboard and do a test programming sequence.

I will create an initial testing project for the CPLD which I am going to program for initial testing, and I will mark it as such and upload the quartus project folder to the GitHub directory. I will spend some time to work on the quartus project, and it will be programmed and uploaded next.

Another test you can do is to measure all the clock generator outputs with a scope just to confirm all the clocks are there.

So we have 16MHz, 14.318MHz, 32.768KHz and 32 MHz on the bottom side SMD oscillator. The latter should have a 3,3V amplitude, of which the clock output is going into both PLLs dedicated clock input pins on the Cyclone II.

Generally when you consider to solder anything onto the board, first check whether doing that will not hamper anything else.
Basically I can say it's best to be able to power on the board, and get all the SMD components soldered first.
Before soldering the FPGA, it's prudent to power on the board and measure all the voltages including the 1.2V analog PLL output.

Note: I soldered the same D-package 1.2V regulator on the analog power input regulator footprint location because Mouser didn't supply the microchip one. So I chose this path. You can carefully scrape off a little more soldermask so you can solder the D-pack instead of the low power microchip one, it's very easy to do.

Okay, next up is creating the first quartus project for the IO decoder and programming that in.
After that I will check a few clock pins and then I will proceed to solder the FPGA, serial configuration flash and the programming headers.
I will have a lot of work to create the complete quartus project for the FPGA, and then I will attempt to flash it into the configuration flash using quartus on the AS mode programming port on the board with the USB blaster programmer. For the FPGA JTAG and AS headers I simply used the complete 10 pin connection so there a straight normal 1:1 10 pin flatcable can be used.

Soldering the 208 pin packages is pretty straight forward, first apply flux on the SMD pads, then pre-tin them with leaded solder by wiping all the pins with plenty of solder on a larger wedge shaped tip. Then clean off the flux and carefully position the CPLD or FPGA. Take ample time to do this, and the reward can be a very straight positioned chip where every pin is spot on in the middle of the pads. After you made the package super straight, then take the iron which you have ready and heated, and simply wipe a few pins on each side from the package outward. This will fixate the package in it's position. Then you can apply flux again and I would suggest using the larger wedge tip first to give each pin a good reflow treatment. Basically what I do is I press down and hold gently on each pin, and then proceed to wipe it from the IC outward on each pin around 6-8 times. This will flow the solder to the pin in a very solid fashion. Using the short wedge tip, it's gentle on the pins, and supplies plenty of heat to do a good reflow job. In fact, I got all the pins solid to the pads in one single pass already. I then replaced the tip with a short cone shaped one with a small tip, and proceeded to wipe all the pins another time just to spread the solder more. Also, if any pin is not straight, the smaller tip end can help to very gently try to nudge the pin into a more straight position. Handle with lots of care of course as not to damage the pad.

More info is coming soon.
You can check the pictures of this phase 1 assembly to also see what is needed to get all the clocks and power ready for measuring and being able to power on the ATX PSU for testing. After all testing, the CPLD initial quartus reduced testing project can be programmed next. The CPLD also outputs the divisions for UART_CLK and TCLK (system timer clock) so you can verify that these clocks are coming out of the CPLD using a scope.

After the CPLD is confirmed, the FPGA can be soldered on next, and the JTAG and AS headers, and then the bus switch ICs, and finally the SRAMs.
The FPGA programming can then be flashed into the serial configuration program. If you can succeed to get this in and quartus makes a correct verification, you can then proceed to add the system ROM and CPU socket. So you can test the CPU whether it's showing signs of life, such as lowering S1 and reading the system ROM, you can see activity on the address lines on the ISA slot, which is then a sign that the FPGA is at least working up to a certain level. So I will detail more things in the next post.

Kind regards,

Rodney
Attachments
REV4_QFP_BOTTOM_PHASE_1.jpg
REV4_QFP_BOTTOM_PHASE_1.jpg (339.45 KiB) Viewed 2599 times
REV4_QFP_TOP_PHASE_1.jpg
REV4_QFP_TOP_PHASE_1.jpg (523.79 KiB) Viewed 2599 times
rodneykn
Site Admin
Posts: 26
Joined: Wed Jul 29, 2026 11:56 pm

Re: Project to create an ATX 80286 mainboard based on the IBM 5170

Post by rodneykn »

I have checked all the voltages on the REV4 QFP mainboard to be correct.
I then proceeded to solder the FPGA, serial flash configuration ROM, bus switch ICs, SRAMs, 286 CPU socket and system ROM socket strips.

After all the SMD ICs in the core FPGA/CPU area were in place and checked to be solid on all the pins, I have soldered in a number of mostly 2200µF capacitors, a few 100µF and some 1000µF capacitors.

Basically I just chose 2200µF capacitors wherever these were able to fit as a general preference. Near the FPGA there was less room because I placed the capacitor footprint a little nearer to the FPGA since this involved the core 1.2V which I was trying to reduce the length of the connection from the cap to the core power plane. I think 1000µF should be fine for the general core 1.2V power supply. If not, I think I should be able to fit a 2200µF later but I think my capacitance provision is likely a lot more than sufficient. So generally I advise to find a smaller footprint type of 2200µF capacitor at 6.3V for the low voltages 5V and below, because this lower voltage also results generally in a smaller diameter capacitor which is better to fit everywhere on the mainboard. In the REV3E system I discovered a general need for more capacitance on the board in the core areas, which was however also due to the trance density in that particular system design. Anyway, after that experience I am now making sure there is no lack of buffer capacitance anywhere on the board for any of the core power nets.

Generally the rule is, start with the SMD ICs after doing phase 1 and programming the IO decoder, and then finish all the SMD ICs, then proceed to add the other components around them making sure you are not hampering access to any component that needs to be added later.

I left out the POST displays, FDC and UART ICs because I want to start up with a lighter load on the system data and address bus since these are shared with the ROM and main system SRAM. After I have been able to verify all is well on the address and data bus, I will proceed to add the remaining IO components, then proceed to test boot the system and after doing some stability and higher clock frequency tests, I will then start doing tests with the integrated PicoGUS. I have no experience with this very cool sound solution yet, so I am leaving this off the board until I have fully verified the system. So more about the PicoGUS experience later.

Now in phase 2 of assembly, I am going to work on the FPGA quartus project in much detail. I have not programmed anything into the serial configuration ROM yet. I still need to replace the system control section in the quartus project with the latest design which is now as good as completely synchronous so this should be much more FPGA compatible already. Likely with the much higher internal clock of the FPGA, I could be even more able to fine tune the READY timing for the 286 to be precisely on a certain clock transition point of which we can then know the exact timing in terms of which clock edge is best to be used.

I chose a 286 CPU (of course, a Harris) which Patrick has verified up to 30MHz, however we also have a CPU socket now so later I will be able to easily swap in another 286 CPU if needed. Regarding the PLCC socket, be very careful what you solder in and inspect the contacts with a strong magnification and light to make sure there is no corrosion on the contacts. Many of the sockets are old stock and it depends on how well they have been kept in the years. The one I used is not a newly bought one because those all had some level of corrosion on them, I instead desoldered the one I am using from a 386SX board where it was used for an optional 387 coprocessor.

Okay, so now I will go over the entire quartus FPGA project for the Cyclone II which will be a lot of work. After doing many checks, I will then proceed to attempt to program the project into the serial configuration ROM on the mainboard using the AS mode connector and the USB blaster.

Here a photo which shows the current state of assembly. I have not powered on the mainboard yet at this moment, I will wait until I am able to attempt a first AS mode flash programming.

Note that I have inserted the 286 and system ROM chip, which is the ROM which was also used in the REV3E system.

Kind regards,

Rodney
Attachments
REV4_QFP_TOP_PHASE_2.jpg
REV4_QFP_TOP_PHASE_2.jpg (863.37 KiB) Viewed 2588 times
rodneykn
Site Admin
Posts: 26
Joined: Wed Jul 29, 2026 11:56 pm

Re: Project to create an ATX 80286 mainboard based on the IBM 5170

Post by rodneykn »

I have done more work on the REV4 QFP FPGA 286 mainboard.

I have observed some activity from the 286 CPU and on the system address and data bus so I decided to add the floppy controller and UART, so I could then solder in the two POST LED displays and see if these produce any updates. So far I have only occasionally seen some value changes on the displays which may have been some kind of glitch occurring.

Primarily I am not yet seeing the ROM CS successfully decoded from the 286 address states. Which is likely due to the ALE signal timing being off.
Of course, the FPGA will need to be handled differently than a CPLD since the logic is much faster and structurally it would be best to use a single fast clock everywhere in the FPGA.

The 286 system control however is dependent on clock transitions relative to the CPU internal cycle timing, and partially asynchronous looking at the cycle status outputs from the 286 and also the timing of these, and of the READY requirements. Thinking about this more, I guess if all efforts fail to pan out, I should create a hybrid system using CPLDs and the FPGA, so that I will be able to transition the system control into the FPGA signal by signal, starting with the cycle initiation and progressing into the cycle mechanisms.

I have had a conversation with google AI and we concluded that possibly using a cycle shift register on the fast FPGA clock and decoding from its taps would be the most safe way to go about creating a FPGA based system control. The timing accuracy of the fast shift register is very secure and stable, and it would theoretically be frequency portable as well since the fast clock transitions are used to time the tap outputs.

Anyway, there have been other challenges as well. For example programming the Cyclone II in AS mode has been extremely unreliable. I am getting some programming into the FPGA, and I can verify that certain clocks like 286_CLK and SYS_CLK are being generated by the FPGA. However I am seeing differences in the operation of the FPGA when looking in more depth.

Also, another quirk has been that I am unable to do the verification of the AS programmed serial configuration flash chip. Currently I am using the Winbond W25Q16JV serial flash chip which I have read it is being used by others as well. However I am unable to verify the programming and it seems not consistent in configuring the FPGA.

For programming the FPGA in quartus II 13.0 sp1, you (apparently) need to compile the project which produces a POF and a SOF file.
Apparently the SOF file can then be used by the FPGA. What I have found out so far is that I am able to use AS programming on the AS header, but I can't do the verification step and I get inconsistent operation from the FPGA. So I shifted to using the JTAG connection to configure the FPGA which appeared more consistent to produce a certain level of expected functionality from the FPGA. For example the BALE signal on the ISA slot is a good reference point. After the FPGA is correctly configured, this signal should be inactive low and active high. In certain occasions I saw it remain high which is of course an error in the configuration process.

So using BALE as a reference, I have found that directly configuring the FPGA through JTAG is much more reliable. Well, then I discovered another way of configuring/programming. Apparently the FPGA can be configured first as a "SFL" serial flash loader. This process can be configured in the "convert programming files" utility which can be found in the file menu of quartus. So when you select a "programming file type" of "JTAG Indirect Configuration file" (JIC extension), this then inserts a "flash loader" programming block in front of the SOF data block. This SFL block needs to be setup for the FPGA type by clicking on "Add Device" in the convert programming files window after selecting the SFL block. You can then choose the device in shortened notation choosing "Cyclone II" and then on the right selecting "EP2C8" which is the FPGA type prefix.

So this will configure the JIC file to include a serial flash loader for the Cyclone II FPGA, which is first configured through the JTAG programming process, and then provides a temporary bridge into the serial flash chip. After the bridge is up, the quartus programmer can then program the serial configuration flash ROM. I have found that using this process, though I am still unable to do the verify step, the programming process is indeed more consistent, in terms of seeing the BALE signal going inactive low and active high, a brief pulse sequence seen after reset which to me right now indicates a more consistent reliable process to program the serial configuration flash chip. So when loading the JIC file in the programmer, this automatically puts a "Factory default SFL image" block in front of the JIC file, which is enabled when clicking the "program/configure" checkmark.

This new finding may lead me to choose the JTAG temporary flash loader bridge method as the default method further along in the future if the experiences in using this method are satisfactory. I can then remove the AS header in a follow up design and other designs using the Cyclone II and save some board area. I may be able to omit a few additional resistors or move these underneath the flash chip for example if the header is no longer used. The FPGA itself will use the AS connection to the flash ROM to program it through the SFL bridge so certain pull ups or pull downs particular to the serial flash ROM access from the FPGA itself will remain necessary in the SFL bridge setup. I can test this later by removing some of the parts no longer necessary. I just want to get down to a reliable standard programming method and it appears for now that using the JTAG port is the better way to go.

So what's next? Well, I will need to revise the entire system control to adapt it to FPGA functionality. So that will mean to convert the logic into clock enables and clocking everything by the fast internal FPGA clock. So far, I have adopted the idea to use a double 286_CLK as the internal FPGA clock. I am trying this right now because it may suit the 286 status and READY timing while doubling as the internal global FPGA clock. For example in my initial design the FPGA clock is 80MHz, the 286_CLK is 40MHz when no cycle control is happening, and the SYS_CLK for now is 20MHz. So with this combination I am seeing a moderate level of operation on the 286 CPU which is more than other frequencies I have tested so far. The PLL part can easily be reconfigured and inserted into the quartus design again, which can then change the three clock speeds as desired.

I will experiment with a few things:
- synchronizing asynchronous 286 status outputs with the FPGA global clock
- try to transition the design into clock enables and clock the registers with the global FPGA clock

In attachment the stage 3 assembly which now includes the FDC, UART, two ISA slot connectors and the POST LED displays. Next I will also solder in some LEDs for status indication for which I have reserved 10 outputs of the CPLD. We can decode and signal lots of things on the LEDs which can help the debugging process.

So it's still a difficult process we need to go through in order to make the FPGA chipset come to life. If anyone is interested and would like to help me, feel free to get in touch. I am developing this system by myself so it all takes a lot of time and work. If someone is willing to help me streamline the process and save valuable time for the actual development process, do please get in touch with me.

Anyway, I will push forward by myself if no one reaches out to me. Likely my projects are mostly unknown so I will probably have to tackle this by myself by experimentation and testing/probing.

Kind regards,

Rodney
Attachments
REV4_QFP_TOP_PHASE_3.jpg
REV4_QFP_TOP_PHASE_3.jpg (807.77 KiB) Viewed 49 times
rodneykn
Site Admin
Posts: 26
Joined: Wed Jul 29, 2026 11:56 pm

Re: Project to create an ATX 80286 mainboard based on the IBM 5170

Post by rodneykn »

In the mean time, I have worked with google AI to develop a clock solution based on the SI5351 in combination with a ATMega328P and a small OLED display. So the solution programs the SI5351 to a default frequency and this can then be changed up or down using two buttons. So the idea is that you can set any clock frequency for the system controller in the REV3E design.

Well, using this setup has proven very useful and informative! I was now able to clock the synchronous REV3E system control up to above 100MHz which then resulted in a 80286 CPU clock of 26MHz for all EMS operations, and even further up to 29MHz for all XMS based operations!

So we can use windows 3.1, format floppies, run benchmarks and do any operation using XMS RAM up to 29MHz, including DMA, IDE drive control, etc.
When playing RealDOOM, for now, we can clock the CPU down a few notches to 26MHz and RealDOOM and the EMS system run happily and 100% stable!

I was able to run 3DBench and it scored 10.2 frames per second at 29MHz.
LM60 reports to see performance equal to an AT at 34MHz.

It's incredible to now see stable operation at these extreme speeds. I didn't need to change anything in the system control design, just upgrade the clock input speed that's all!

Anyway, this little setup using the SI5351 and ATMega328 certainly inspires me to want to integrate these into the REV3 setup where we can have an actual programmable clock generator in our system, we can use a cool OLED display for status info and we can use the ATMega328 as the ATX power on and RESET controller as well. I want to add port 80h access for the ATMega controller and enable it to RESET the system after updating the clock speed. There will also be a USB to serial input debugging and control port to do any type of debugging with a modern PC, as well as set the clock speed of the REV3 system, RESET it, etc., communicate with user programs using the terminal. Basically anything is possible with user programs on the REV3 like sending messages to the USB to serial port connected modern PC or other computers. Maybe for example we can even figure out how to type stuff into the system DOS prompt using the USB to serial input by using the IO decoder CPLD to bridge the connections and keep the 8042 IO access quiet while we do this. Anyway, it's just an idea.

So I will look into a REV3F design with onboard system management and programmable clock generator. I may likely add a PicoGUS into the system as well if I can make it fit. I may design and build this system if it is able to fit on a smaller Micro-ATX board surface. This will reduce my costs further.

I had some serious issues this time with my cheap LCD scope. It was not at all reliable anymore to show me the clock signal waveforms. It even showed me a 10-20MHz clock shape while it was actually close to 100-120MHz! I really saw neat wave shapes which had nothing to do with the reality, which threw us off for a while during the development of the clock generator system!

Anyway we gained some experience using this extremely common ATMega328 controller which has a solid future proof backing. So we are going to dive in more deeply to use the ATMega328 in future designs to do a lot more cool stuff including the POST info on an OLED display, etc.

Amazing news to be running windows 3.1 at the clock speed of 29Mhz without any artifacts or quirks.
DMA keeps running perfectly fine now at 4.8MHz DMA clock generated from a division inside the system controller.
So this frequency range of DMA clock is matching our full test clock range and there were no issues with floppy DMA, sound and music also works 100% stable at 29MHz clock speed without any additional changes to the system. I only restored the address bus driver programming which monitors VGA RAM cycles to decode these as slow AT cycle types, so we can go above 26MHz and have a steady clean VGA display on the Diamond Speedstar ISA VGA card.

I ran Vidspeed.exe to test system RAM and it reported 19323 writes per millisecond!
I was able to test RealDOOM 0.89 at 26MHz and it ran 100% stable including sound and SFX, with full graphic detail, I got a score running timedemo demo3 of 7.8 frames per second, 10549 realtics. So this is with VGA cycle control enabled. I could turn this off and test again, though I doubt it will make much difference for RealDOOM in my experience. I think the biggest performance load is for the 80286 to generate the screen output.

So far, I am still working on the QFP FPGA system, however it is proving to be a challenge. It appears that the system control is not easily ported over to FPGA using clock enable pulses and a single fast global FPGA clock. In theory it looks sound, but the 80286 so far is not liking the new logic yet. So more news will follow as soon as I have gotten the 80286 to read the ROM and perform the POST up to a certain level.

Here a few images of my test work with the new clock generator setup.

Kind regards,

Rodney
Attachments
Clock_display.jpg
Clock_display.jpg (80.26 KiB) Viewed 31 times
ATMega328P.jpg
ATMega328P.jpg (95.45 KiB) Viewed 31 times
SI5351_MOUNTED_IN_REV3E.jpg
SI5351_MOUNTED_IN_REV3E.jpg (107.63 KiB) Viewed 31 times
MRBIOS_29MHZ.jpg
MRBIOS_29MHZ.jpg (156.81 KiB) Viewed 31 times
LM60_AT_29MHZ_CLOCK.jpg
LM60_AT_29MHZ_CLOCK.jpg (168.31 KiB) Viewed 31 times
rodneykn
Site Admin
Posts: 26
Joined: Wed Jul 29, 2026 11:56 pm

Re: Project to create an ATX 80286 mainboard based on the IBM 5170

Post by rodneykn »

Okay so I have worked a lot on getting familiar with verlog.
And what better way than to just dive into it and working out a whole project.

So I chose the REV3E address bus driver as a test subject and had a chat with google AI.
I asked how things work and it offered some useful examples what verilog code looks like.
Mostly it's pretty straight forward and intuitive.
Though some quirks gave me some minor troubles.
Finally I figured ways to work around limitations such as declaring a bus which you would want to define in portions.
That's just not possible to further along modify a bus which is declared.
The PC/AT is a complicated system and not defined in a straight forward way, particularly because of DMA, data byte conversion and A20 gating.

Anyway I figured out a way which I am pleased with to implement the fragmented buses into complete 23 bit CPU, DMA-1 and DMA-2 address bus structures, and these were in one go multiplexed onto the internal MX_A bus, which I then use for decoding purposes, and we output SBHE, SA0-SA20 for example onto the slot, where SA20 is only used on the SRAM address bus where we feature the 1MByte SRAMs in the 16 bit construction. Anyway since the structure matched the whole system address bus idea of IBM, I decided to expand the idea with SA20 so we can use the IBM design for our 1MB SRAMs.

Okay, so I have managed to program the entire Address bus driver CPLD in verilog now. I transitioned the design into 4 verilog components first, which I wired together in the BDF design, and finally I merged the three verilog blocks in one single straight forward verilog design file. So I prefer not to use some form of construction to create units of partial designs and then connect these together. Instead I just took the design parts and manually blended them into a single verilog "module".

I have done this recent work for a number of reasons, for example:

(1) Verilog is a universal language and can be used with any FPGA chip of any brand. It's not package specific. Basically you can take the design on another branded chip, if it can support the logic and pin count, and the I/O standards needed, you can program and use the FPGA. Portability of the entire design serves the purpose of preservation of the original technology.

(2) We now have the REV4 design FPGA version mainboard built up. I have been working on it but so far the system is not showing a CPU that is persistently trying to run code. So something is up in the timing and clock operation of course. Anyway I will get on top of this, however for this purpose, the REV4 project will be well served with a few 100% verified verilog components which theoretically I should be able to instantiate as block design file components. These can then be wired to the other verilog stuff like the core AT controller chips. So the more of the REV4 system I can port pre-defined, the less change of any issues in the REV4 testing and debugging work.
So for now my plan includes to make the CPLDs very portable in the form of verilog code for each complete chip. I will then copy the CPLDs into a complete quartus project, restructure them to suit the FPGA, and we can go on from there.

(3) We will want to use verilog more and more in the future since it an offer lots of cool interfaces and capabilities in systems which are built around FPGAs. Which in the future will benefit all our projects. Remember, when we have a fully HDL defined PC/AT system, we can port the whole thing to any FPGA basis that can accept the entirety of it.

So one of our goals will be to ultimately have a completely portable IBM 5170 system with all the compatibility with an entire range or historic time period software and games. Basically running this FPGA design, you can have the complete authentic time period experience of using a PC that behaves and operates exactly the same as in the time period.

Okay so I will include the first verilog design for the REV3E Address bus driver. This CPLD contains the entire address bus structure for the PC/AT except the memory address bus however that is merely an extension of the system address bus anyway so it's nothing new or complex to be found there. The Address bus driver creates the system address bus of the PC/AT which stands at the center of the address bus structure. Basically everything connects there in order to operate. During active period of the 80286 it drives the system address bus, and during DMAC1/2 activity they will run the system address bus according to the 5170 standard principles. So I have put the Address bus driver in charge of running the DMACs including the DMA arbitration, DMA mid address latching and driving the DMA page mapper controls.
The cool thing about verilog is also that only a few lines of code an multiplex together 3 separate 24 bit address buses into a single multiplexed bus. Basically in the verilog design I have restructured the address bus so that we have an internal multiplexed bus which is then directly driving all address memory decoding and partial IO address decoding. For external devices, the SA bus is tri-state capable and output to the ISA slots and onboard stuff like the EMS controller which buffers it into the memory address bus.

Okay, here is the code, it's not fully annotated yet in terms of commenting on the code lines, which I will elaborate on more in the future. Anyway, at least it's fully verified and tested in the REV3E Address bus driver CPLD, which is now programmed completely without even having any BDF block design schematic in the quartus project. Just the verilog module as top design file and the pin placement, that's it, and quartus was happy to compile the project.

Code: Select all


module addres_driver_decoder (
input wire ALE,			// GLOBAL INPUT PIN
input wire MASTER_n,		// GLOBAL INPUT PIN
input wire M_IO_n,		// GLOBAL INPUT PIN
input wire BHE,			// GLOBAL INPUT PIN
input wire L_A0_IN,		// GLOBAL INPUT PIN
input wire [23:1] A,		// GLOBAL INPUT PIN											// RENAMED INPUT 10 286_A20 to A20, SPLIT_REG_MUX_IN_2
input wire [8:0] XA,		// GLOBAL INPUT PIN
input wire [7:0] XD,		// GLOBAL INPUT PIN
input wire MAP_A20,		// GLOBAL INPUT PIN
input wire DMA1_A16,		// GLOBAL INPUT PIN (WAS MAP_A16)						// RENAME IT BACK TO MAP_A16??
input wire A20_GATE,		// GLOBAL INPUT PIN
input wire HRQ1,			// GLOBAL INPUT PIN
input wire DMA_MEMR_n,	// GLOBAL INPUT PIN
input wire DMA_MEMW_n,	// GLOBAL INPUT PIN
input wire IOCH_RDY,	// GLOBAL INPUT PIN
input wire DMA_CLK,	// GLOBAL INPUT PIN
input wire SYS_CLK,	// GLOBAL INPUT PIN
input wire HLDA_286,	// GLOBAL INPUT PIN												// RENAME PIN 164 286_HLDA
input wire RESET_n,	// GLOBAL INPUT PIN
input wire INTA_n,		// GLOBAL INPUT PIN
input wire IOR_n,		// GLOBAL INPUT PIN
input wire IOW_n,		// GLOBAL INPUT PIN
input wire EMS_DEFAULT_n,	// GLOBAL INPUT PIN
input wire FDC_DC_n,    	// GLOBAL INPUT PIN DC_n input van floppy port
input wire DACK3_n,	// GLOBAL INPUT PIN
input wire DACK7_n,	// GLOBAL INPUT PIN
input wire DACK2_n,	// GLOBAL INPUT PIN
input wire DACK6_n,	// GLOBAL INPUT PIN
input wire DACK0_n,	// GLOBAL INPUT PIN
input wire DACK4_n,	// GLOBAL INPUT PIN
input wire DMA1_EOP_n,	// GLOBAL INPUT PIN
input wire DMA2_EOP_n,	// GLOBAL INPUT PIN
input wire DMA1_AEN,	// GLOBAL INPUT PIN
input wire DMA2_AEN,	// GLOBAL INPUT PIN
input wire DMA1_ADSTB, // GLOBAL INPUT PIN
input wire DMA2_ADSTB, // GLOBAL INPUT PIN
input wire MEM_CS_16_n,	// GLOBAL INPUT PIN
inout wire MEMR_n,		// GLOBAL BIDIR PIN
inout wire MEMW_n,		// GLOBAL BIDIR PIN
// CONSIDERING SA0-SA19 AND SBHE TO BECOME BIDIR FOR BUS MASTER SUPPORT
output wire DMA1_CS_n,	// GLOBAL OUTPUT PIN
output wire DMA2_CS_n,	// GLOBAL OUTPUT PIN
output wire AEN_n, 		// GLOBAL OUTPUT PIN
output wire ROM8_CS_n,	// GLOBAL OUTPUT PIN
output wire SBHE,			// GLOBAL OUTPUT PIN							// CONSIDER TO BECOME BIDIR FOR MASTER
output wire [20:0] SA,	// GLOBAL OUTPUT PIN							// CONSIDER TO BECOME BIDIR FOR MASTER
output wire [23:17] LA,	// GLOBAL OUTPUT PIN
output wire HRQ_286, 	// GLOBAL OUTPUT PIN							// RENAME PIN 163 286_HRQ
output wire HLDA1, 		// GLOBAL OUTPUT PIN
output wire DMA_RDY, 	// GLOBAL OUTPUT PIN
output wire SMEMR_n, 	// GLOBAL OUTPUT PIN
output wire SMEMW_n, 	// GLOBAL OUTPUT PIN
output wire XMS_LED_n, 	// GLOBAL OUTPUT PIN
output wire EMS_LED_n, 	// GLOBAL OUTPUT PIN
output wire MAP_MA0, 	// GLOBAL OUTPUT PIN
output wire MAP_MA1, 	// GLOBAL OUTPUT PIN
output wire MAP_MA2,		// GLOBAL OUTPUT PIN
output wire DACK4,		// GLOBAL OUTPUT PIN
output wire T_C, 			// GLOBAL OUTPUT PIN
output wire MAP_R_W_n,	// GLOBAL OUTPUT PIN
output wire AEN_1_n,		// GLOBAL OUTPUT PIN
output wire AEN_2_n,		// GLOBAL OUTPUT PIN
output wire PG_REG_CS_n, // GLOBAL OUTPUT PIN
output wire XD_DIR,		// GLOBAL OUTPUT PIN
output wire SD7,			// GLOBAL OUTPUT PIN
output wire EMS_RANGE_n, // GLOBAL OUTPUT PIN
output wire MEM_BUS_n, 	// GLOBAL OUTPUT PIN
output wire SLOW_AT_CYCLE_n,	// GLOBAL OUTPUT PIN
output wire XMS_1L_CS_n, 	// GLOBAL OUTPUT PIN
output wire XMS_1H_CS_n, 	// GLOBAL OUTPUT PIN
output wire XMS_2L_CS_n, 	// GLOBAL OUTPUT PIN
output wire XMS_2H_CS_n,	// GLOBAL OUTPUT PIN
output wire XMS_3L_CS_n, 	// GLOBAL OUTPUT PIN
output wire XMS_3H_CS_n, 	// GLOBAL OUTPUT PIN
output wire XMS_4L_CS_n, 	// GLOBAL OUTPUT PIN
output wire XMS_4H_CS_n,	// GLOBAL OUTPUT PIN
output wire XMS_5_n, 	// GLOBAL OUTPUT PIN
output wire XMS_6_n, 	// GLOBAL OUTPUT PIN
output wire XMS_7_n, 	// UNUSED PIN
output wire XMS_8_n, 	// UNUSED PIN
output wire ABD1,		 	// UNUSED PIN
output wire ABD2,  		// UNUSED PIN
output wire ABD3,	 		// UNUSED PIN
output wire ABD4,		 	// UNUSED PIN
output wire MD_DIR,	 	// UNUSED PIN
output wire SYSCON_3,	// UNUSED PIN
output wire DATA1,	 	// UNUSED PIN
output wire DATA2,	 	// UNUSED PIN
output wire MEM_RD_WR_n, 	// UNUSED PIN

output reg SM_IO_n,			// GLOBAL OUTPUT REG
output reg FSYS_16,        // 'reg' wordt in dit geval geen register
output reg BIOSRAM_LED_n		// GLOBAL OUTPUT REG
);

// INTERNAL REGS:
reg L_BHE;
reg L_F16;			     // interne register LATCH F16 STATE FROM CPU
reg [15:8] DMA1_reg;    // interne register declaratie
reg [16:9] DMA2_reg;    // interne register declaratie
reg [23:1] L_A_reg;     // 23 registers want L_A0 komt van SYSCON
reg [23:0] MX_A;         // 'reg' worden in dit geval geen registers DECLARE MX_A MUXED BUS NEEDS REG
reg DMA_READY_0;
reg DMA_READY_1;
reg DMA_MEMR_OUT_n;
reg LHRQ1;
reg LHRQ2;
reg QRTR_CLK;
reg DMA1_ADSTB_DLY;		// INTERNAL REG LATER
reg DMA2_ADSTB_DLY;		// INTERNAL REG LATER
reg MX_SBHE;				// 'reg' wordt in dit geval geen register

// VARIOUS INTERNAL WIRES
wire A20_GATED = &{A[20], A20_GATE};						// GATE A[20] TO A20_GATED, THEN LATCH IT TO L_A BUS
wire AEN_1 = ~AEN_1_n;
wire AEN_2 = ~AEN_2_n;
wire DMA_READ = ~&{IOR_n, DMA_MEMR_n};
wire DMA_AEN = ~&{AEN_1_n, AEN_2_n};
wire CLR_READY_0_n  = ~|{~DMA_AEN, DMA_READY_1};    // laag wanneer DMA_AEN_n=1 of DMA_READY_1=1
wire DMACS_n = &{DMA1_CS_n, DMA2_CS_n};              // hoog als er geen DMA chip select actief is
wire IO_CMD_n = &{IOR_n, IOW_n};                     // hoog als er geen IO command actief is
wire FB_286_HLDA = &{HLDA_286, ~REQ_286_HRQ};
wire REQ_286_HRQ = ~|{~LHRQ1, FB_286_HLDA};
wire GATE_286_HRQ = |{DMACS_n, IO_CMD_n};        //   GATE THE 286_HRQ IF NO DMAC BEING PROGRAMMED
wire STBCLK1_IN = &{DMA1_ADSTB, ~DMA_CLK};
wire STBCLK2_IN = &{DMA2_ADSTB, ~DMA_CLK};
wire EMS_DEFAULT = ~EMS_DEFAULT_n;

// IO ADDRESS COMPARES
wire DMA1 = (L_A[9:5] == 5'b00000);            // DMA1      PORT 000h
wire DMA2 = (L_A[9:5] == 5'b00110);            // DMA2      PORT 0C0h
wire FDC_CR = (L_A[9:0] == 10'b1111110111);    // FDC_CR    PORT 3F7h
wire NP = (L_A[9:3] == 7'b0011111);            // NPCS      PORT 0F8h
wire PGR = (L_A[9:4] == 6'b001000);            // PG_REG    PORT 0F8h
wire PB = (L_A[9:0] == 10'b0001100001);        // PORT B	PORT 061h

// MEMORY ADDRESS COMPARES
wire EMS_07 = (MX_A[23:19] == 5'b00000);     // 000000h - 07FFFFh (EMS 0-7)
wire EMS_8 = (MX_A[23:16] == 8'h08);   	   // 080000h - 08FFFFh (EMS 8)
wire EMS_9 = (MX_A[23:16] == 8'h09);   		// 090000h - 09FFFFh (EMS 9)
wire EMS_D  = (MX_A[23:16] == 8'h0D);        // 0D0000h - 0DFFFFh (UMB / EMS D)
wire EMS_E  = (MX_A[23:16] == 8'h0E);        // 0E0000h - 0EFFFFh (UMB / EMS E)
wire RAM_00 = (MX_A[23:19] == 5'b00000);		// RAM 00 ADDRESS COMPARE
wire RAM_08 = (MX_A[23:17] == 7'b0000100);	// RAM 08 ADDRESS COMPARE
wire RAM_0D = (MX_A[23:16] == 8'h0D);			// RAM 0D ADDRESS COMPARE
wire RAM_0E = (MX_A[23:16] == 8'h0E);			// RAM 0E ADDRESS COMPARE
wire RAM_1 = (MX_A[23:20] == 4'h1);         // RAM 1-2MB RANGE ADDRESS COMPARE (NO EMS DEFAULT)
wire CNV_00 = &{RAM_00, EMS_DEFAULT};			// ADD EMS_DEFAULT TO CONVENTIONAL DECODING
wire CNV_08 = &{RAM_08, EMS_DEFAULT};			// ADD EMS_DEFAULT TO CONVENTIONAL DECODING
wire CNV_0D = &{RAM_0D, EMS_DEFAULT};			// ADD EMS_DEFAULT TO CONVENTIONAL DECODING
wire CNV_0E = &{RAM_0E, EMS_DEFAULT};			// ADD EMS_DEFAULT TO CONVENTIONAL DECODING
wire RAM_02 = (MX_A[23:21] == 3'b001);       // 200000h - 3FFFFFh (3e en 4e MB)
wire RAM_5  = (MX_A[23:21] == 3'b010);       // 400000h - 5FFFFFh (5e en 6e MB)
wire RAM_6  = (MX_A[23:21] == 3'b011);       // 600000h - 7FFFFFh (7e en 8e MB)
wire MEG    = (MX_A[23:20] == 4'h0);         // 000000h - 0FFFFFh (Eerste 1 MB)
wire OPTROM = (L_A[23:15] == 9'b000011001);  // 0C8000h - 0CFFFFh (Option ROM)
wire BIOSL  = (L_A[23:16] == 8'h0F);         // 0F0000h - 0FFFFFh (BIOS mirror)
wire BIOSH  = (L_A[23:16] == 8'hFF);         // FF0000h - FFFFFFh (BIOS top)
wire V0A    = (A[23:16] == 8'h0A);           // 0A0000h - 0AFFFFh (VGA grafisch)
wire V0B    = (A[23:16] == 8'h0B);           // 0B0000h - 0BFFFFh (VGA tekst)
wire V0C0   = (A[23:15] == 9'b000011000);    // 0C0000h - 0C7FFFh (VGA BIOS)

// IO RELATED WIRES
wire FDC_LDCR_n = ~&{FDC_CR, AEN_n, ~SM_IO_n};  // LOAD CR   PORT 3F7h
wire PORT_B_n = ~&{PB, AEN_n, ~SM_IO_n};      // PORT 061
wire NPCS_n = ~&{NP, ~SM_IO_n, INTA_n, AEN_n};  // NPCS_n COMPLETE EQN
wire ROM8_READ = ~|{ROM8_CS_n, MEMR_n};        // ROM8_READ POSITIVE ACTIVE
wire XIO = ~|{L_A[8], L_A[9], IOR_n};              // L_A8, L_A9, IOR_n ALL ZERO 
wire XIO_EXC = &{XIO, NPCS_n, PORT_B_n};       // EXCEPTION FOR NPU OR PORT B
wire FDC_LDDC = ~|{FDC_LDCR_n, IOR_n};         // READ ON PORT 3F7 POSITIVE ACTIVE

// MEMORY RELATED WIRES

wire RAM_01_CS_n = ~|{CNV_00, CNV_08, CNV_0D, CNV_0E, RAM_1};
wire RAM_02_CS_n = ~RAM_02;
wire CPU_AEN = ~HLDA_286;
wire SA_OE = |{DMA_AEN, CPU_AEN};
wire RAM_CS_n = &{RAM_01_CS_n, RAM_02_CS_n, XMS_5_n, XMS_6_n};   
wire F16 = ~&{RAM_01_CS_n, RAM_02_CS_n, EMS_RANGE_n, XMS_5_n, XMS_6_n,  MEM_CS_16_n};
wire MEG_CS_n = ~MEG;
wire [23:0] DMA1_A;    									// DECLARE DMA1 ADDRESS BUS
wire [23:0] DMA2_A;    									// DECLARE DMA2 ADDRESS BUS
wire [23:0] L_A;											// DECLARE LATCHED CPU ADDRESS BUS

// ASSEMBLING BUSES FOR LATER MUXING:

// ASSEMBLE L_A BUS FROM ASSEMBLED L_A_reg BUS and L_A0_IN FROM SYSCON
assign L_A[23:0] = {L_A_reg[23:1], L_A0_IN};		
	 
// ASSEMBLE THE DMA 1 AND 2 ADDRESS BUS TO 24 BITS
assign DMA1_A[23:21] = A[23:21]; // LATER INPUT FROM PAGE REG IN FPGA
assign DMA1_A[20] = MAP_A20;      // LATER INPUT FROM PAGE REG IN FPGA
assign DMA1_A[19:17] = A[19:17];  // LATER INPUT FROM PAGE REG IN FPGA
assign DMA1_A[16] = DMA1_A16;     // LATER INPUT FROM PAGE REG IN FPGA
assign DMA1_A[15:8] = DMA1_reg[15:8];
assign DMA1_A[7:0] = XA[7:0]; 
assign DMA2_A[23:21] = A[23:21];  // LATER INPUT FROM PAGE REG IN FPGA
assign DMA2_A[20] = MAP_A20;      // LATER INPUT FROM PAGE REG IN FPGA
assign DMA2_A[19:17] = A[19:17];  // LATER INPUT FROM PAGE REG IN FPGA
assign DMA2_A[16:9] = DMA2_reg[16:9];
assign DMA2_A[8:1] = XA[8:1];
assign DMA2_A[0] = 1'b0; 

    always @(posedge DMA1_ADSTB_DLY) begin
       DMA1_reg[15:8] <= XD[7:0];
    end

    always @(posedge DMA2_ADSTB_DLY) begin
       DMA2_reg[16:9] <= XD[7:0];
    end

    always @(posedge ALE) begin         
       L_A_reg[23:1] <= {A[23:21], A20_GATED, A[19:1]};      // RE-ASSEMBLE AND STORE CPU ADDRESS BUS AFTER GATING A20
    end

    always @(posedge ALE) begin
       L_BHE <= BHE;                 // LATER CONVERT TO A CLOCK ENABLE IN FPGA
    end

    always @(posedge ALE) begin
      SM_IO_n <= M_IO_n;             // LATER CONVERT TO A CLOCK ENABLE IN FPGA
    end

    always @(negedge ALE) begin
     L_F16 <= F16;                   // LATER CONVERT TO A CLOCK ENABLE IN FPGA
    end
	 
    always @(*) begin
        case ({CPU_AEN, AEN_1, AEN_2})
            3'b100: MX_A[23:0] = L_A[23:0];			// L_A COMPLETE BUS IS ASSEMBLED USING ASSIGN
            3'b010: MX_A[23:0] = DMA1_A[23:0];		// DMA1_A COMPLETE BUS IS ASSEMBLED USING ASSIGN
            3'b001: MX_A[23:0] = DMA2_A[23:0];		// DMA2_A COMPLETE BUS IS ASSEMBLED USING ASSIGN
            default: MX_A = 24'h000000; 				// Voorkomt een ongewenste latch!
        endcase
     end

    always @(*) begin
        case ({CPU_AEN})
            1'b1: FSYS_16 = L_F16;		// CPU ACTIVE, USE LATCHED VERSION
            1'b0: FSYS_16 = F16;                // CPU IN HOLD, USE DIRECT UNLATCHED VERSION
            default: FSYS_16 = 1'b0;      // Voorkomt een ongewenste latch!
        endcase
    end

    always @(*) begin
        case ({CPU_AEN, AEN_1})
            2'b10: MX_SBHE = L_BHE;		// CPU ACTIVE, USE LATCHED VERSION
            2'b01: MX_SBHE = ~XA[0];           // CPU IN HOLD, USE DIRECT UNLATCHED VERSION
            default:MX_SBHE = 1'b0;      	// DMA-2 en voorkomt ook een ongewenste latch!
        endcase
    end

	 always @(posedge DMA_READ or negedge IOCH_RDY or negedge CLR_READY_0_n) begin
        if (~IOCH_RDY) begin              // IOCH_RDY = 0
            DMA_READY_0 <= 1'b1;          // 1e prioriteit: Asynchrone Preset wanneer IOCH_RDY laag is
        end 
        else if (~CLR_READY_0_n) begin    // CLR_READY_0_n = 0
            DMA_READY_0 <= 1'b0;          // 2e prioriteit: Asynchrone Clear (NOR van DMA_AEN_n en DMA_READY_1)
        end 
        else begin
            DMA_READY_0 <= 1'b1;          // 3e prioriteit: Klokactie op posedge DMA_READ
        end
    end

    always @(posedge DMA_CLK or negedge RESET_n) begin
        if (~RESET_n) begin               // RESET_n = 0
            DMA_READY_1 <= 1'b0;	  			// 1e prioriteit: Asynchrone clear wanneer RESET_n laag is
        end
        else begin
	    DMA_READY_1 <= DMA_READY_0;   		// 2e prioriteit: Klokactie op posedge DMA_CLK
        end
    end

    always @(posedge DMA_CLK or negedge RESET_n) begin
        if (~RESET_n) begin               // RESET_n = 0: asynchrone clear
            LHRQ1 <= 1'b0;	  					// 1e prioriteit: asynchrone clear wanneer RESET_n laag is
        end
        else begin
	    LHRQ1 <= HRQ1;        					// 2e prioriteit: Klokactie op posedge DMA_CLK
        end
    end

    always @(posedge DMA_CLK or negedge RESET_n) begin
        if (~RESET_n) begin               // RESET_n = 0: asynchrone preset
            DMA_MEMR_OUT_n <= 1'b1;	  // 1e prioriteit: asynchrone preset wanneer RESET_n laag is
        end
        else begin
	    DMA_MEMR_OUT_n <= DMA_MEMR_n;        // 2e prioriteit: Klokactie op posedge DMA_CLK
        end
    end


    always @(posedge SYS_CLK or negedge RESET_n) begin
        if (~RESET_n) begin               // RESET_n = 0
            LHRQ2 <= 1'b0;	  // 1e prioriteit: Asynchrone clear wanneer RESET_n laag is
        end
        else begin
	    LHRQ2 <= LHRQ1;   // 2e prioriteit: Klokactie op posedge SYS_CLK
        end
    end

     always @(negedge ROM8_CS_n or negedge RAM_CS_n) begin
        if (~ROM8_CS_n) begin               // ROM8_CS_n = 0
            BIOSRAM_LED_n <= 1'b0;	  // 1e prioriteit: Asynchrone clear wanneer ROM8_CS_n laag is
        end
        else if (~RAM_CS_n) begin
	    BIOSRAM_LED_n <= 1'b1;        // 2e prioriteit: Asynchrone preset wanneer RAM_CS_n laag is
        end
    end

    always @(posedge SYS_CLK or negedge RESET_n) begin
        if (~RESET_n) begin
            QRTR_CLK <= 1'b0;
        end else begin
            QRTR_CLK <= ~QRTR_CLK;    // Deelt SYS_CLK door 2 bij elke opgaande flank
        end
    end

    always @(posedge QRTR_CLK or negedge RESET_n) begin
        if (~RESET_n) begin               // RESET_n = 0
            DMA1_ADSTB_DLY <= 1'b0;	  // 1e prioriteit: Asynchrone clear wanneer RESET_n laag is
        end
        else begin
	    DMA1_ADSTB_DLY <= STBCLK1_IN;   // 2e prioriteit: Klokactie op posedge QRTR_CLK
        end
    end

    always @(posedge QRTR_CLK or negedge RESET_n) begin
        if (~RESET_n) begin               // RESET_n = 0
            DMA2_ADSTB_DLY <= 1'b0;	  // 1e prioriteit: Asynchrone clear wanneer RESET_n laag is
        end
        else begin
	    DMA2_ADSTB_DLY <= STBCLK2_IN;   // 2e prioriteit: Klokactie op posedge QRTR_CLK
        end
    end


assign SA[20:0] = SA_OE    ? MX_A[20:0] : 21'bz;    	// OUTPUT TRI-STATE SA BUS TO THE SLOTS
assign SBHE = SA_OE    ? MX_SBHE    : 1'bz;     		// OUTPUT TRI-STATE SBHE TO THE SLOTS
assign LA[23:17] = MASTER_n ? A[23:17]   : 7'bz;     	// OUTPUT TRI-STATE LA BUS TO THE SLOTS
assign HRQ_286 = &{GATE_286_HRQ, REQ_286_HRQ};     	//   AND NO IO COMMANDS IN PROGRESS
assign HLDA1 = &{REQ_286_HRQ, HLDA_286, LHRQ2};    	//	HLDA1 OUTPUT TO DMAC-2
assign MEMR_n = DMA_AEN ? DMA_MEMR_OUT_n : 1'bz;   	//   OUTPUT FOR DMA MEMORY COMMAND ONLY
assign MEMW_n = DMA_AEN ? DMA_MEMW_n : 1'bz;       	//   OUTPUT FOR DMA MEMORY COMMAND ONLY
assign SMEMR_n = |{MEMR_n, MEG_CS_n};
assign SMEMW_n = |{MEMW_n, MEG_CS_n};
assign DMA_RDY = ~|{DMA_READY_0, DMA_READY_1};     	//   DMA_RDY NAAR BEIDE DMACS
assign XMS_LED_n = RAM_CS_n;
assign EMS_LED_n = EMS_DEFAULT_n;
assign AEN_1_n = ~&{DMA1_AEN, MASTER_n};
assign AEN_2_n = ~&{DMA2_AEN, MASTER_n, DACK4_n};
assign DACK4 = ~DACK4_n;										// OUTPUT TO DMAC-1
assign MAP_MA0 = &{DACK3_n, DACK7_n};
assign MAP_MA1 = &{DACK2_n, DACK6_n};
assign MAP_MA2 = ~DACK0_n;
assign T_C = ~&{DMA1_EOP_n, DMA2_EOP_n};
assign MAP_R_W_n = ~IOR_n;
assign AEN_n = ~&{MASTER_n, HLDA_286};
assign DMA1_CS_n   = ~&{DMA1, AEN_n, ~SM_IO_n}; 		// PORT 000 - 01F
assign DMA2_CS_n   = ~&{DMA2, AEN_n, ~SM_IO_n}; 		// PORT 0C0 - 0DF
assign PG_REG_CS_n = ~&{PGR, AEN_n, ~SM_IO_n};  		// PORT 080 - 08F
assign SD7 = FDC_LDDC ? ~FDC_DC_n : 1'bz;      			// OUT FDC_DC TO SD7 WHERE FDC_LDDC = OE
assign XD_DIR = ~|{XIO_EXC, ~INTA_n, ROM8_READ};  		// XIO, INTERRUPTS, 8 BIT ROM ON XD BUS
assign XMS_5_n         = ~RAM_5;
assign XMS_6_n         = ~RAM_6;
assign ROM8_CS_n       = ~|{OPTROM, BIOSL, BIOSH};
assign EMS_RANGE_n     = ~|{EMS_07, EMS_8, EMS_9, EMS_D, EMS_E};
assign MEM_BUS_n 			= &{RAM_01_CS_n, RAM_02_CS_n, EMS_RANGE_n, XMS_5_n, XMS_6_n};        
assign SLOW_AT_CYCLE_n = ~|{V0A, V0B, V0C0, OPTROM, BIOSL, BIOSH};
assign XMS_1L_CS_n     = |{RAM_01_CS_n, MX_A[0]};
assign XMS_1H_CS_n     = |{RAM_01_CS_n, MX_SBHE};
assign XMS_2L_CS_n     = |{RAM_02_CS_n, MX_A[0]};
assign XMS_2H_CS_n     = |{RAM_02_CS_n, MX_SBHE};	 
assign ABD1 = 1'bz;
assign ABD2 = 1'bz; 
assign ABD3 = 1'bz;
assign ABD4 = 1'bz;
assign MD_DIR = 1'bz;
assign SYSCON_3 = 1'bz;
assign DATA1 = 1'bz;
assign DATA2 = 1'bz;
assign XMS_3L_CS_n = 1'bz;
assign XMS_3H_CS_n = 1'bz;
assign XMS_4L_CS_n = 1'bz;
assign XMS_4H_CS_n = 1'bz;
assign XMS_7_n = 1'bz;
assign XMS_8_n = 1'bz;
assign MEM_RD_WR_n = 1'bz;

endmodule

So this is the first of 5 CPLDs that make up the REV3E design.

Maybe at first glance the REV3E may seem very elaborate, but if anyone takes the actual time and effort to build the system, they will also understand how cool this system really is. It's kind of the enthusiasts system really where there was no compromise in creating the design really. The system contains a very complete PC/AT and many of the IBM 5170 principles are safely adopted into the system. It's really a pleasure to use in my opinion. I can recommend building one to all visitors, and with enough accuracy and persistence, it is very doable to build.

As I mentioned, I am going to look into a REV3F system which may be interesting if I could succeed to fit the entire system on a micro ATX form factor board. Even if I could not do that, I may still design a full ATX sized REV3F, possibly for experimenting with an FPGA on the design, for example, and doing much more. Maybe I can include a VGA or HDMI connector on the IO shield section that are capable to be controlled by the FPGA. I still have plans to adopt the AO486 VGA controller to run in 16 bit mode from the 32 bit wishbone FPGA bus. Also, micro SD card slots and other experiments could be conveniently done on a REV3 system if an FPGA could be added. I have also thought about possibly featuring an FPGA on some sort of SODIMM module that is easy to click into a mainboard and move between systems. I mean, if I work with verilog anyway, we can choose any FPGA and make some kind of affordable module with it.
We can feature system management using a ATMEGA controller, because that seems to be the most widely available controller chip.
So the system manager can also reprogram the SI5351 clock oscillator(s) to drive all the onboard frequencies we need. If we need more clocks, maybe it's a good idea to let a few more SI5351 chips handle that.

Okay I will elaborate more next time, and I will start working my way through the entire REV3E system until I am able to redefine it into a single FPGA package. We will have some clock and timing related challenges however the first step will be to port the technology, and then we can look into clock enable constructions. I will have some talks with google AI about how that is typically best handled. The big challenge there to clock enable the fast global FPGA clock signal to drive a clock with the timing of another slower clock transition, is to get a reliable clock enable pulse going for all the relative slower clock transitions. The clock enable needs to run completely in sync with the slower clocks, to which also the 80286 has synchronized itself.

A final word about the new clock increases for the Harris 80286 CPU. So this runs 100% stable at 29MHz for all operations except EMS memory related operation. After doing the Verilog design, I discovered that RealDOOM was not working anymore. Previously google AI gave me some tips which some of them I tried for the sake of increasing speed. However now I found that the memory decoding was no longer functional for RealDOOM. So just now I changed it back to conform with my original design. And I was able to run RealDOOM again so it was certainly a logic error. Anyway, the important point is, I have tested RealDOOM again, and I am now able to run RealDOOM at 27MHz!
So for EMS I click the clock speed down a few steps to 27MHz, which is then completely stable to run RealDOOM.
Apparently the verilog version of the design is slightly faster in the address setup, it appears. Later I can also look into early ALE assertion, which may increase the total clock speed further as well since the SRAMs could potentially gain more address setup time which may benefit the clock range of the REV3E system as well.

Anyway it may possibly start to become a factor in my tests what the actual real clock limits will be for the 80286 itself, when we eliminate more and more speed restrictions in our chipset, it then starts more to come down to how fast the 80286 itself is capable of performing. I remember buying a relatively affordable IBM PS/1 model 2121 PC in the 1990s years to do my school work on, and that one was 16MHz. I mean, this Harris previous generation 80286 is now certainly able to run circles around that IBM PC, really, we have come a long way with the project! When booting into DOS, it's starting to look more like a 486 really how fast the DOS text is scrolling, which I have not seen a 286 do so fast before.

Everyone who is following me here, many thanks for your interest, and if you like to, feel free to reach out to me, and if you like to participate in the talks here, you can request your own login, no problem and fans of the project who are enthusiasts about the time period technology are more than welcome to actively join me here!

Kind regards,

Rodney
Post Reply