Sorry. I should have added _n.
signal inversion is not required.
Good point, but in this case it is not the problem. Before using SDRAM I was using 256KB of BRAM, and the BIOS detects and reports the amount of memory available, even with that bug, it should identify and be able to use 512KB without any problem.kitune-san wrote: ↑Sat May 28, 2022 4:26 pm A bug was found in RAM.sv of KFPC-XT.
The RAM access range was 00000h-9FFFFFh, but it was 00000h-7FFFFFh.
An error may have occurred when accessing 80000h-9FFFFFh.
https://github.com/kitune-san/KFPC-XT/c ... 4cfde55893
HMA?
It still doesn't work, I update your changes in the specific branch to address this issue:kitune-san wrote: ↑Sun May 29, 2022 8:15 am The following changes are being considered.
https://github.com/kitune-san/KFPC-XT/c ... 17e7ffd6c7
RAM.sv and KFSDRAM.sv works in my DE0-CV.
Oh...spark2k06 wrote: ↑Sun May 29, 2022 9:48 amIt still doesn't work, I update your changes in the specific branch to address this issue:kitune-san wrote: ↑Sun May 29, 2022 8:15 am The following changes are being considered.
https://github.com/kitune-san/KFPC-XT/c ... 17e7ffd6c7
RAM.sv and KFSDRAM.sv works in my DE0-CV.
https://github.com/spark2k06/PCXT_MiSTe ... sdram-test
Don't worry, you've already done enough in this regard, we'll find the cause at some point
It must be something specific to the signal configuration of the MiSTer.
This is how it was already configured:kitune-san wrote: ↑Sun May 29, 2022 11:27 am
Oh...
Can the SDRAM I/O Standard be changed to 3.3V LVTTL?
That's all I can come up with now.
Code: Select all
;-------------------------------------------------------------------------
; Test first 32 KiB (MIN_RAM_SIZE) of RAM
mov al,e_low_ram_test
out post_reg,al
xor si,si
xor di,di
mov ds,di
mov es,di
mov dx,word [warm_boot+biosdseg*16] ; save soft reset flag to DX
mov ax,55AAh ; first test pattern
mov cx,MIN_RAM_SIZE*512 ; RAM size to test in words
rep stosw ; store test pattern
mov cx,MIN_RAM_SIZE*512 ; RAM size to test in words
.1:
lodsw
cmp ax,55AAh ; compare to the test pattern
jne low_ram_fail
loop .1
xor si,si
xor di,di
mov ax,0AA55h ; second test pattern
mov cx,MIN_RAM_SIZE*512 ; RAM size to test in words
rep stosw ; store test pattern
mov cx,MIN_RAM_SIZE*512 ; RAM size to test in words
.2:
lodsw
cmp ax,0AA55h ; compare to the test pattern
jne low_ram_fail
loop .2
xor di,di
xor ax,ax ; zero
mov cx,MIN_RAM_SIZE*512 ; RAM size to test in words
rep stosw ; zero the memory
jmp low_ram_ok ; test passed
low_ram_fail:
mov al,e_low_ram_fail ; test failed
out post_reg,al
;-------------------------------------------------------------------------
; Low memory error: beep - pause - beep - pause ... - 400 Hz
mov al,0B6h
out pit_ctl_reg,al ; PIT - channel 2 mode 3
mov ax,pic_freq/400 ; 400 Hz signal
out pit_ch2_reg,al
mov al,ah
out pit_ch2_reg,al
in al,ppi_pb_reg
.1:
or al,3 ; turn speaker on and enable
out ppi_pb_reg,al ; PIT channel 2 to speaker
mov cx,0
.2:
nop
loop .2
and al,0FCh ; turn of speaker
out ppi_pb_reg,al
mov cx,0
.3:
nop
loop .3
jmp .1
Have you changed any of the following?spark2k06 wrote: ↑Sun May 29, 2022 9:48 am It still doesn't work, I update your changes in the specific branch to address this issue:
https://github.com/spark2k06/PCXT_MiSTe ... sdram-test
Don't worry, you've already done enough in this regard, we'll find the cause at some point
It must be something specific to the signal configuration of the MiSTer.
Code: Select all
assign SDRAM_nCS = ~SDRAM_CS;
assign SDRAM_nCAS = ~SDRAM_CAS;
assign SDRAM_nRAS = ~SDRAM_RAS;
assign SDRAM_nWE = ~SDRAM_WE;
Code: Select all
assign SDRAM_nCS = SDRAM_CS;
assign SDRAM_nCAS = SDRAM_CAS;
assign SDRAM_nRAS = SDRAM_RAS;
assign SDRAM_nWE = SDRAM_WE;
kitune-san wrote: ↑Sun May 29, 2022 2:33 pm
Have you changed any of the following?Inversion is not necessary.Code: Select all
assign SDRAM_nCS = ~SDRAM_CS; assign SDRAM_nCAS = ~SDRAM_CAS; assign SDRAM_nRAS = ~SDRAM_RAS; assign SDRAM_nWE = ~SDRAM_WE;
Code: Select all
assign SDRAM_nCS = SDRAM_CS; assign SDRAM_nCAS = SDRAM_CAS; assign SDRAM_nRAS = SDRAM_RAS; assign SDRAM_nWE = SDRAM_WE;
Code: Select all
assign SDRAM_DQ_IN = SDRAM_DQ;
assign SDRAM_DQ = ~SDRAM_DQ_IO ? SDRAM_DQ_OUT : 16'hZZ;
I don't know any, I've always used debuggers from DOS.
It is necessary to ensure that the two outputs do not collide.spark2k06 wrote: ↑Sun May 29, 2022 2:45 pm What I am not so sure about is this:
Code: Select all
assign SDRAM_DQ_IN = SDRAM_DQ; assign SDRAM_DQ = ~SDRAM_DQ_IO ? SDRAM_DQ_OUT : 16'hZZ;
How do I regenerate those files from Quartus, because starting from a new compilation, they are not updated...kitune-san wrote: ↑Sun May 29, 2022 11:37 pm
It is necessary to ensure that the two outputs do not collide.
16'hzzzz" is more accurate than "16'hzz".
Synopsys Design Constraints (.sdc) files are created by the designer. It is not generated.
kitune-san wrote: ↑Mon May 30, 2022 1:42 pm
Synopsys Design Constraints (.sdc) files are created by the designer. It is not generated.
Even if SDC was not the cause of this problem, this file should be created.
Also needed for timing analysis.
I have tried both 4.77Mhz and 7.16Mhz... in neither case has it passed the test.kitune-san wrote: ↑Mon May 30, 2022 1:55 pm By the way, is the CPU clock at the time of RAM check 4.77MHz?
Great. Yes, because although it passes the test, it doesn't seem to work very well, I haven't managed to get the initial BIOS screen to come up.kitune-san wrote: ↑Tue May 31, 2022 12:17 pm I will fix the SDRAM.sv because the self refresh operation is not working.
CKE is not LOW during the refresh command.
I will not modify the refresh, but increasing the parameter time may stabilize the operation.