I tried to add the pll into the block schematic and went through the megawizard which can also be recalled and taken through the settings again at any later stage for an update to the block component.
So mostly it's just a matter of filling in the values, and the megawizard will create a number of HDL files and a block schematic part for the altpll function. If you update it, it can overwrite a new set of files.
And what's significant here for our understanding is that you can verify the actual operation mode of the PLL, which is shown in a confusing way due to a simplification of the factors displayed next to the values you entered, is to read a bit lower on the screen what the running values will be for fVCO for the PLL.
In the attachment the example steps for creating 286_CLK and HDL_CLK.
So I named the general FPGA clock signal HDL_CLK to illustrate that it's the clock used for general FPGA mechanisms.
In the attachment you can see below the resulting value for fVCO is indeed 768 MHz as per the example frequency scheme I wrote about.
I was not able to set this myself anywhere but it's still automatically concluded from the values of factors.
So it's good to be able to actually see that value there.
So with the 24/48 MHz values for SYS_CLK and 286_CLK, we would divide fVCO by 6 and end up with 128 MHz for the fast internal FPGA clock.
I am doing that also because I want to be able to modify the value for m and then end up with a range of 286_CLK between 18 and 30 MHz roughly and end up with what I think are reasonable values for the FPGA clock. So this can enable us to easily and quickly test with other frequencies to clock the 286 with.
Okay so I finished this part of the design now and moving on where I added the pll component into the block schematic and wired it in.
And there also becomes evident that we, in the current design evolving from REV3D, cannot output the PLL clock directly on the PLL_OUT pin.
That's because we want to manipulate the 286_CLK in novel ways which is just incompatible to the PLL_OUT idea.
Anyway I added the 286_CLK output pin on the PLL_OUT pin of PLL 1 anyway since this is also a normal IO pin if the design needs that instead.
Though I don't see this actual specific use unless we keep the CPU frequency constant which so far has only worked at around 16-18MHz.
In that case the VGA cycles are really efficient and practically identical to the normal RAM access.
And that is of course cool and interesting but practically not very useful for our goal to increase the performance.
Which is always going to need cycle speed manipulation to be an integral part.
After creating the PLL HDL file set, I reviewed the code and I did see a lot of options which are not exposed to connections in the block schematic part for the PLL.
Anyway due to the nature of our PC/AT project, I don't see any purpose for clock output enables to be used so I didn't try to pursue that in more detail.
Possibly if that is the case, quartus could deduce it by itself and use the clock control block area of the chip automatically I suppose.
Which it already seems to do for the clock multiplexer used for 286 cycle control since it lists a message about this to be "protecting" that area.
In the technology map view quartus shows the HDL code of the PLL in separate block diagram parts spread out in the diagram.
So after looking at the existing clock design in the system controller, I revisited the SYS_CLK / PCLOCK usage in the design with a few experiments in the REV3D system controller.
However the apparent issue is that SYS_CLK by design starts running at the moment when the 286 asserts the first cycle status outputs to read the ROM code.
So that's rather specific and cannot be exchanged with PCLOCK which is always running to first sync the 286 to the clock when coming out of RESET.
Same goes for the RESET_286 logic suggested by Intel and elaborated by IBM in the 5170 design.
That 286 RESET area added by IBM naturally follows from other sections in the 286 documentation book by Intel for when the 286 executes the status output sequence resulting in resetting the 286 separately while the rest of the system including the VGA controller keeps running.
Changing any area, at least in the REV3D system, where we know that the CPLD designs can also be sensitive to modifications, results in a range of outcomes between moderately stable but showing timing mismatches to completely not posting. Finally I abandoned that work when it became apparent that it won't lead to useful outcomes for the REV4.
Besides possible sensitivity of the REV3D to modifications, several areas in the design just appear to need the SYS_CLK behavior which becomes active at the first assertion of the 286 status outputs and cannot run on a constantly active clock during system or 286-only RESETs.
So the conclusion so far is that we are going to need both SYS_CLK and PCLOCK in the REV4 design.
I can do more testing in case we can succeed to fully debug the REV4 ISA test card.
Also it remains unclear why in the REV3D system controller SYS_CLK and PCLOCK seemed to be in phase with eachother.
At least, I have measured that earlier with my simple LCD scope which surprised me at the time.
Likely it's due to the timing of ENAS which depends on the 286 which determines a specific falling edge of 286_CLK the SYS_CLK will transition on.
Which will be a delicate process that also depends on the clock speed itself. Which would also explain why the REV3D system operates best in a specific clock speed window, which makes sense.
In the design and during the debugging of the REV3D, I have gone on pure observation of stability tests to choose certain design modifications.
The system will quickly show it if anything is slightly off so that's useful to pick up on more or less stable functionality.
So later in the debugging work I observed the phase alignment between PCLOCK and SYS_CLK.
Depending on the 286_CLK frequency, SYS_CLK may "jump" on another phase.
I am sure in the FPGA it will be more certain which phase it will jump to compared to the REV3D.
We can modify this accordingly.
Definitely in the REV1 design they were counter phased so it must be the timing of that specific CPLD being different resulting in a different outcome for SYS_CLK.
Anyway, of course I moved the REV3D design forward according to what designs functions best which led to the final quartus versions so far which I published on GitHub.
And in addition we raised the clock above 20MHz which changes many areas of the system control design timing so that needed to be compensated for.
That includes the READY timing which is also delicate.
By the way, I observed specific differences in compilation approach by quartus when working with an FPGA.
One remarkable thing is how quartus deals with those D-flipflops which specifically have active signals on both the preset and clear inputs.
Here, quartus is more aware of the situation and modifies the circuit to accommodate that usage.
In the CPLD design I have had to make my own modifications, and even created two D-flipflops using a number of NAND3 gates to get better operation mode and timing.
Which of course takes more logic fabric but it's just necessary to gain the same efficiency as with lower clocks.
Of course you can modify the preset and clear inputs with some gates but that only is able to result in an override when both are applied, either way as you wish.
So the mileage on that varies as well. To get both outputs to go high, in fact, to even obtain both those outputs, it really needs the NAND approach in speed critical areas.
I did see some alternative D-flipflop parts but I never tested out their operation mode, and quartus throws a message that it's not advisable to use these parts.
So I am now going to work on the schematic to update with the final pin assignments, and then I will look at the other areas of the design.
I am thinking to dual purpose certain pins to possibly be able to generate some display output even when the 286 is on the card.
Which could be cool for diagnostics during the debugging since we don't have the POST displays.
But I am not sure to what degree this could possibly work yet. Maybe only MDA type of output, and there is also the amount of logic needed which I don't know yet, I will update more on this later when I know more details. If there is some chance to get some type of display output, I will prepare the card PCB for that.
So the REV4 test card is going to use 4 layers and I will order the cards made with ENIG finish since this is more solid and structurally stronger to solder larger SMD parts.
Kind regards,
Rodney
So mostly it's just a matter of filling in the values, and the megawizard will create a number of HDL files and a block schematic part for the altpll function. If you update it, it can overwrite a new set of files.
And what's significant here for our understanding is that you can verify the actual operation mode of the PLL, which is shown in a confusing way due to a simplification of the factors displayed next to the values you entered, is to read a bit lower on the screen what the running values will be for fVCO for the PLL.
In the attachment the example steps for creating 286_CLK and HDL_CLK.
So I named the general FPGA clock signal HDL_CLK to illustrate that it's the clock used for general FPGA mechanisms.
In the attachment you can see below the resulting value for fVCO is indeed 768 MHz as per the example frequency scheme I wrote about.
I was not able to set this myself anywhere but it's still automatically concluded from the values of factors.
So it's good to be able to actually see that value there.
So with the 24/48 MHz values for SYS_CLK and 286_CLK, we would divide fVCO by 6 and end up with 128 MHz for the fast internal FPGA clock.
I am doing that also because I want to be able to modify the value for m and then end up with a range of 286_CLK between 18 and 30 MHz roughly and end up with what I think are reasonable values for the FPGA clock. So this can enable us to easily and quickly test with other frequencies to clock the 286 with.
Okay so I finished this part of the design now and moving on where I added the pll component into the block schematic and wired it in.
And there also becomes evident that we, in the current design evolving from REV3D, cannot output the PLL clock directly on the PLL_OUT pin.
That's because we want to manipulate the 286_CLK in novel ways which is just incompatible to the PLL_OUT idea.
Anyway I added the 286_CLK output pin on the PLL_OUT pin of PLL 1 anyway since this is also a normal IO pin if the design needs that instead.
Though I don't see this actual specific use unless we keep the CPU frequency constant which so far has only worked at around 16-18MHz.
In that case the VGA cycles are really efficient and practically identical to the normal RAM access.
And that is of course cool and interesting but practically not very useful for our goal to increase the performance.
Which is always going to need cycle speed manipulation to be an integral part.
After creating the PLL HDL file set, I reviewed the code and I did see a lot of options which are not exposed to connections in the block schematic part for the PLL.
Anyway due to the nature of our PC/AT project, I don't see any purpose for clock output enables to be used so I didn't try to pursue that in more detail.
Possibly if that is the case, quartus could deduce it by itself and use the clock control block area of the chip automatically I suppose.
Which it already seems to do for the clock multiplexer used for 286 cycle control since it lists a message about this to be "protecting" that area.
In the technology map view quartus shows the HDL code of the PLL in separate block diagram parts spread out in the diagram.
So after looking at the existing clock design in the system controller, I revisited the SYS_CLK / PCLOCK usage in the design with a few experiments in the REV3D system controller.
However the apparent issue is that SYS_CLK by design starts running at the moment when the 286 asserts the first cycle status outputs to read the ROM code.
So that's rather specific and cannot be exchanged with PCLOCK which is always running to first sync the 286 to the clock when coming out of RESET.
Same goes for the RESET_286 logic suggested by Intel and elaborated by IBM in the 5170 design.
That 286 RESET area added by IBM naturally follows from other sections in the 286 documentation book by Intel for when the 286 executes the status output sequence resulting in resetting the 286 separately while the rest of the system including the VGA controller keeps running.
Changing any area, at least in the REV3D system, where we know that the CPLD designs can also be sensitive to modifications, results in a range of outcomes between moderately stable but showing timing mismatches to completely not posting. Finally I abandoned that work when it became apparent that it won't lead to useful outcomes for the REV4.
Besides possible sensitivity of the REV3D to modifications, several areas in the design just appear to need the SYS_CLK behavior which becomes active at the first assertion of the 286 status outputs and cannot run on a constantly active clock during system or 286-only RESETs.
So the conclusion so far is that we are going to need both SYS_CLK and PCLOCK in the REV4 design.
I can do more testing in case we can succeed to fully debug the REV4 ISA test card.
Also it remains unclear why in the REV3D system controller SYS_CLK and PCLOCK seemed to be in phase with eachother.
At least, I have measured that earlier with my simple LCD scope which surprised me at the time.
Likely it's due to the timing of ENAS which depends on the 286 which determines a specific falling edge of 286_CLK the SYS_CLK will transition on.
Which will be a delicate process that also depends on the clock speed itself. Which would also explain why the REV3D system operates best in a specific clock speed window, which makes sense.
In the design and during the debugging of the REV3D, I have gone on pure observation of stability tests to choose certain design modifications.
The system will quickly show it if anything is slightly off so that's useful to pick up on more or less stable functionality.
So later in the debugging work I observed the phase alignment between PCLOCK and SYS_CLK.
Depending on the 286_CLK frequency, SYS_CLK may "jump" on another phase.
I am sure in the FPGA it will be more certain which phase it will jump to compared to the REV3D.
We can modify this accordingly.
Definitely in the REV1 design they were counter phased so it must be the timing of that specific CPLD being different resulting in a different outcome for SYS_CLK.
Anyway, of course I moved the REV3D design forward according to what designs functions best which led to the final quartus versions so far which I published on GitHub.
And in addition we raised the clock above 20MHz which changes many areas of the system control design timing so that needed to be compensated for.
That includes the READY timing which is also delicate.
By the way, I observed specific differences in compilation approach by quartus when working with an FPGA.
One remarkable thing is how quartus deals with those D-flipflops which specifically have active signals on both the preset and clear inputs.
Here, quartus is more aware of the situation and modifies the circuit to accommodate that usage.
In the CPLD design I have had to make my own modifications, and even created two D-flipflops using a number of NAND3 gates to get better operation mode and timing.
Which of course takes more logic fabric but it's just necessary to gain the same efficiency as with lower clocks.
Of course you can modify the preset and clear inputs with some gates but that only is able to result in an override when both are applied, either way as you wish.
So the mileage on that varies as well. To get both outputs to go high, in fact, to even obtain both those outputs, it really needs the NAND approach in speed critical areas.
I did see some alternative D-flipflop parts but I never tested out their operation mode, and quartus throws a message that it's not advisable to use these parts.
So I am now going to work on the schematic to update with the final pin assignments, and then I will look at the other areas of the design.
I am thinking to dual purpose certain pins to possibly be able to generate some display output even when the 286 is on the card.
Which could be cool for diagnostics during the debugging since we don't have the POST displays.
But I am not sure to what degree this could possibly work yet. Maybe only MDA type of output, and there is also the amount of logic needed which I don't know yet, I will update more on this later when I know more details. If there is some chance to get some type of display output, I will prepare the card PCB for that.
So the REV4 test card is going to use 4 layers and I will order the cards made with ENIG finish since this is more solid and structurally stronger to solder larger SMD parts.
Kind regards,
Rodney
Attachments
Last edited:

