The RTF65002 Core
Re: The RTF65002 Core
What's your FPGA utilization - roughly? Are you using BRAMS internally?
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Re: The RTF65002 Core
Quote:
What's your FPGA utilization - roughly? Are you using BRAMS internally?
10895 LUTs
1112 FF's
25 BRAMs
4 DSP block (for the multiplier)
No, there is no internal BRAM usage except for the caches. It's not a microcoded design so there's no control tables to it.
The core was/is done in a manner to be developed as rapidly as possible. So it's somewhat inefficient in its use of resources.
I'm relying on the tools to do the thinking for me
Re: The RTF65002 Core
Quote:
I think that I read somewhere that Lee used BCD mode in one or two places in EhBasic.
The overflow error is coming from FAC arithmetic. I've looked at several cases where BNE/BCS/BMI are used to indicate overflow but haven't found
a problem yet.
I ran 1,500 line processor test successfully, but still have a problem *somewhere*. Ugh.
Re: The RTF65002 Core
Quote:
I think that I read somewhere that Lee used BCD mode in one or two places in EhBasic
I also get the message "@@@@ bytes free".
- barrym95838
- Posts: 2056
- Joined: 30 Jun 2013
- Location: Sacramento, CA, USA
Re: The RTF65002 Core
Quote:
... The overflow error is gone, and I get the "Enhanced BASIC 2.22" prompt, But when I try and type in a program nothing lists back.
I also get the message "@@@@ bytes free".
I also get the message "@@@@ bytes free".
I was never a big fan of self-modifying techniques, but I believe that it was used in many of the interpreters written for 8-bitters in the 70s. Well, I guess that I have no right to judge, since I never felt the need to squeeze cycles, and was always prouder of my space optimizations, from a hobbyist's perspective. I believe that Woz had a similar philosophy, but I would have to take a closer look at his Integer BASIC to confirm this. dclxvi is an expert on this subject ... perhaps he would like to chime in?
Mike
Re: The RTF65002 Core
I managed to track the problem down to a faulty sta (d),y instruction. Well I fixed it and EhBASIC seems to work now. It's running! with interrupts occurring switching to 32 bit mode, then returning to eight bit mode successfully.
I had coded in Verilog a compare if (ir==`STA_IY) and I needed to add a bit select on ir like (ir[7:0]==`STA_IY).
Self modifying code is sometimes a substitute for a more powerful instruction set. I used self-modifying code for graphics performance by having the raster op dynamically replaced. AND switched to OR, switched to COPY, etc. So there was no case statements (branches) for the raster op.
The EXEC instruction which usually executes an instruction contained in a register is available on some architectures. The instruction can be used to avoid self-modifying code. Maybe I should add some sort of EXEC to the processor. hmm.
I had coded in Verilog a compare if (ir==`STA_IY) and I needed to add a bit select on ir like (ir[7:0]==`STA_IY).
Self modifying code is sometimes a substitute for a more powerful instruction set. I used self-modifying code for graphics performance by having the raster op dynamically replaced. AND switched to OR, switched to COPY, etc. So there was no case statements (branches) for the raster op.
The EXEC instruction which usually executes an instruction contained in a register is available on some architectures. The instruction can be used to avoid self-modifying code. Maybe I should add some sort of EXEC to the processor. hmm.
- barrym95838
- Posts: 2056
- Joined: 30 Jun 2013
- Location: Sacramento, CA, USA
Re: The RTF65002 Core
Rob Finch wrote:
... Maybe I should add some sort of EXEC to the processor. hmm.
Code: Select all
main exe instr
brk
instr jsr foo
stp
foo rts
Mike
Re: The RTF65002 Core
Quote:
Several instructions use/modify the instruction pointer ... how do you think that should be treated?
Code: Select all
ld ibuf,#SOME_INSTRUCTION
....
EXEC ibuf
....
Code: Select all
ALOOP:
CMP #AND
BNE j1
AND r1,r1,r2
BRA j2
j1 CMP #OR
BNE j3
OR r1,r1,r2
BRA j4
...
j2
j3
ENDALOOP:
Code: Select all
ld ibuf,#Operation ; operation is the desire AND/OR/EOR/COPY etc.
.....
ALOOP:
EXEC ibuf
...
ENDALOOP
.....
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: The RTF65002 Core
It's similar to Forth's EXECUTE which executes the word (routine) whose address is at the top of the data stack. PERFORM is the indirect equivalent (which could be defined as @ EXECUTE), where the top data-stack cell tells where to read the address of the word to execute. I can see that having an assembly-language equivalent would have its uses, but I wonder if they would be enough to justify having it.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
- barrym95838
- Posts: 2056
- Joined: 30 Jun 2013
- Location: Sacramento, CA, USA
Re: The RTF65002 Core
Cool, guys ... I think that I understand, mostly.
Garth, I know that your version of Forth uses absolute addressing for BRANCH, but let's assume that you EXECUTE a fig-Forth style relative branch instruction. Is the target of the branch relative to the IP of the EXECUTE instruction, or relative to the address of the BRANCH instruction? Also, does the relative address literal come directly after the EXECUTE, or directly after the BRANCH?
Mike
Garth, I know that your version of Forth uses absolute addressing for BRANCH, but let's assume that you EXECUTE a fig-Forth style relative branch instruction. Is the target of the branch relative to the IP of the EXECUTE instruction, or relative to the address of the BRANCH instruction? Also, does the relative address literal come directly after the EXECUTE, or directly after the BRANCH?
Mike
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: The RTF65002 Core
Quote:
Garth, I know that your version of Forth uses absolute addressing for BRANCH
Quote:
but let's assume that you EXECUTE a fig-Forth style relative branch instruction. Is the target of the branch relative to the IP of the EXECUTE instruction, or relative to the address of the BRANCH instruction? Also, does the relative address literal come directly after the EXECUTE, or directly after the BRANCH?
Code: Select all
['] FOOBAR EXECUTECode: Select all
HEADER "EXECUTE", NOT_IMMEDIATE ; ( addr -- )
EXECUTE: PRIMITIVE
LDA 0,X ; Get the address from the top of the data stack
STA W ; and put it in the word pointer.
INX_INX ; Drop the top stack item since we're done with it.
JMP W-1
;-------------------http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
- barrym95838
- Posts: 2056
- Joined: 30 Jun 2013
- Location: Sacramento, CA, USA
Re: The RTF65002 Core
GARTHWILSON wrote:
... We get off topic a lot but I guess it applies to the OP.
Or better yet, I could just RTFM first! I have several fig-FORTH sources, but I confess that I only understand how to translate them, not actually use them in any meaningful way, at least not yet.
Mike
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: The RTF65002 Core
barrym95838 wrote:
Or better yet, I could just RTFM first! I have several fig-FORTH sources, but I confess that I only understand how to translate them, not actually use them in any meaningful way, at least not yet.
Anyway, although I haven't tried any assembly-language coding with an EXEC instruction to execute a full instruction held in a register, I've been thinking it sounds kind of cool.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: The RTF65002 Core
I decided not to implement an EXEC instruction. I tried it, and it made the whole core bigger and slower. The problem is that the pc increment for each instruction has to be squashed. It's replaced by an increment the size of the EXEC instruction (2 bytes). It's not to bad to do when instructions are the same size and there's only one place the pc is incremented, but I have pc increments of different amount all over the place. It affected things like stacking return addresses on the stack.
The alternative solution was to specify that the EXEC instruction had to be followed by up to seven NOPs, to account for variations in instruction length.
It would take two 32 bit registers to hold an instruction to execute.
I've been thinking about trying to port Forth to the processor, and had a look at the Fig-Forth code.
My assembler isn't compatible with the source code, so there's lots of edits to be done.
The alternative solution was to specify that the EXEC instruction had to be followed by up to seven NOPs, to account for variations in instruction length.
It would take two 32 bit registers to hold an instruction to execute.
I've been thinking about trying to port Forth to the processor, and had a look at the Fig-Forth code.
My assembler isn't compatible with the source code, so there's lots of edits to be done.
Re: The RTF65002 Core
Okay, how about having some way to modify the next instruction in the stream by ORing (or XORing) in some bitmask? I've seen this stunt pulled with a microcoded architecture, where the microcode can write to a register that mixes a value into the next microinstruction, it was used for indexed register access, indirect jumps, selecting an ALU operation, all sorts of crazy stuff. I don't know if it's of interest to you, but it's a possible angle.