Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #37365
| Date | 2015-03-18 01:53 +0000 |
|---|---|
| From | Jan Coombs <Jan-54 <jenfhaomndgfwutc@murmic.plus.com>> |
| Newsgroups | comp.lang.forth |
| Subject | Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack |
| Message-ID | <20150318015322.0a6b1e50@T60A> (permalink) |
| References | <21045760-f834-4d9c-9bb0-d13f2c1ff3b4@googlegroups.com> <20150316171323.35c7c26b@T60A> <9d1cd881-2054-419f-88e9-f161cabe1314@googlegroups.com> |
On Tue, 17 Mar 2015 02:40:14 -0700 (PDT)
mfanyikazi@gmail.com wrote:
> James Bowman's J1 FPGA
The j1 can return the stack pointers, but not set them, so you will
need to extend it to do multi-tasking.
I'd do the task switch in hardware like NC4016 (in old app note?):
Add two new hardware registers, and map them into j1 I/O space:
task-selector - to select a task, must initialise to zero.
last-task - last task to run, must initialise to zero.
Make multiple copies of DSP and RSP, only an extra 10 latches per task,
plus mux code to select active pair using task-selector
Use larger memories for D and R stacks, and drive most significant
address bits with task-selector
: pause ( ? -- ? ) (R ? -- ? ) \ simplest - runs tasks 0 to last-task
\ call to pause has pushed curr task return address
dup \ push TOS register onto stack
\ wrap task selector, even if out of range
task-selector @ 1+ dup last-task @ >= if drop 0 then
task-selector ! \ switch stacks, (or not if single tasking)
noop \ may need delay for h/w here
drop \ refill task TOS register
; \ exit to address retrieved from R stack
: my-task ( -- ) \ code for task
begin pause ( do something ) again ;
: setup-task ( c-addr task# -- ) \ hookup task
task-selector ! execute pause ;
' my-task 1 setup-task \ setup task 1
1 last-task ! \ allow task 1 to run
0 last-task ! \ single task only
Warning: All from memory, deliberately crude and obvious, more
could be moved into hardware, and refined, ...
Would you like some help to test this?
Jan Coombs
--
email valid, else fix dots and hyphen
jan4clf2014@murrayhyphenmicroftdotcodotuk
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack mfanyikazi@gmail.com - 2015-03-16 09:30 -0700
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack jenfhaomndgfwutc@murmic.plus.com - 2015-03-16 17:13 +0000
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack mfanyikazi@gmail.com - 2015-03-17 02:40 -0700
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack Jan Coombs <Jan-54 <jenfhaomndgfwutc@murmic.plus.com>> - 2015-03-18 01:53 +0000
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack rickman <gnuarm@gmail.com> - 2015-03-17 23:21 -0400
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack albert@spenarnc.xs4all.nl (Albert van der Horst) - 2015-03-16 22:24 +0000
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack rickman <gnuarm@gmail.com> - 2015-03-17 14:01 -0400
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack JUERGEN <epldfpga@aol.com> - 2015-03-17 11:59 -0700
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack rickman <gnuarm@gmail.com> - 2015-03-17 16:28 -0400
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-18 15:30 +0000
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack Bernd Paysan <bernd.paysan@gmx.de> - 2015-03-18 22:12 +0100
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack "Rod Pemberton" <buzz@notnotnontnooatno.cmm> - 2015-03-16 18:57 -0400
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack mfanyikazi@gmail.com - 2015-03-17 02:52 -0700
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack "Rod Pemberton" <buzz@notnotnontnooatno.cmm> - 2015-03-17 18:03 -0400
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-18 14:39 +0000
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack mfanyikazi@gmail.com - 2015-03-17 02:58 -0700
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-03-17 16:48 +0000
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack Lars Brinkhoff <lars.spam@nocrew.org> - 2015-03-18 12:16 +0100
Re: Is it possible to have the following words (RP@ RP! SP@ SP!) on hardware data and return stack Lars Brinkhoff <lars.spam@nocrew.org> - 2015-03-18 12:43 +0100
csiph-web