Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.lang.forth > #24040

Re: OT (slightly) What is the "best" processor for a new project?

From Bernd Paysan <bernd.paysan@gmx.de>
Newsgroups comp.lang.forth
Subject Re: OT (slightly) What is the "best" processor for a new project?
Date 2013-07-01 02:02 +0200
Organization 1&1 Internet AG
Message-ID <kqqguv$9sj$1@online.de> (permalink)
References (11 earlier) <21d980bc-12c9-477a-8df6-bd345c884e4a@googlegroups.com> <kqhiea$b6i$1@online.de> <53f1cf80-acb4-46d2-823f-2512d9d6c05f@googlegroups.com> <kqq0i4$r29$1@online.de> <0a55ff9e-15cf-4b61-952f-d43c6133a3dc@googlegroups.com>

Show all headers | View raw


hughaguilar96@yahoo.com wrote:
>> Since you can just write expressions in a C-like syntax, declare named
>> registers, and such.  I.e. since the very beginning.  Due to the inherent
>> parallel nature of Verilog, writing sequential processes is easier in
>> assembler, but when you write a primitive for a processor, you actually
>> don't want sequential stuff.
> 
> The assembler executed up to 5 instructions in parallel, all packed into a
> single opcode.

And? In Verilog, you can have as much parallel things as you like.

>> > It is true that the MiniForth assembly-language was
>> > pretty low-level, but I learned it, so it is not impossible to learn.
>> > You have to change the design of the processor hardware to get a new
>> > primitive. And, as I've said before, you are limited to 32 primitives
>> > --- so to add a new one, you have to remove an existing one.
>> 
>> Or change the number of primitives to 64, which is a piece of cake.
> 
> 64 is still an order of magnitude too few. Make it a couple of thousand
> --- still a piece of cake?

Yes, decoder-wise it is no problem to have as many bits for each instruction 
as you like.  But even the x86, which has a hell lot of operations with all 
the extensions like SSE, MMX, FP, AES-NI and whatsoever has still a lot less 
than thousands.

Thousands is just pure nonsense, because the MinForth architecture was slow 
at Forth, and therefore needed fast assembler code to get the required 
speed.

> The point that I'm making, is that adding new primitives doesn't involve
> using more gates internally, and requiring a larger chip --- if you have a
> well-designed assembly-language, you can write hundreds of primitives
> without requiring a bigger chip --- your "compromise" was self imposed.

And if you have a Forth processor, all these "primitives" are actually high-
level code... but utilize the gates of the chip just as good as an 
assembler.

> Local variables were added to the MiniForth quite late in the project. I
> was asked to provide local variables, but I said that the MiniForth as it
> currently was designed, would not support locals. John Hart responded by
> upgrading the MiniForth to provide a frame of 16 16-bit words at a fixed
> location in data memory, along with new instructions in the assembly
> language that accessed them. This was a lot like how local variables are
> implemented on the 8051 for the C language. So I wrote the local variable
> code to use that frame and to support up to 16 local variables per
> function. I also wrote a lot of code that did stuff with the locals, such
> as +! and so forth --- this was when I also introduced the "ghost
> primitives" that I mentioned earlier, as most of this code never got used
> (because none of the colon words in the application program had that many
> local variables).

Ah, I see.  A fixed frame in data memory is not really what I consider 
"locals", as it is not reentrant...  Since you didn't work on the processor, 
and you didn't also work on the assembler code, you simply don't understand 
how to factor such things into parts which don't let your primitive number 
explode.  If I would add locals to the b16, I would use the address register 
model (first b16 variant, similar to GA144), and have a frame pointer which 
can compute a sum of fp+offset and store it in the address register, where 
it can be used for load and store.  There is no point to have +! as 
instruction, because it takes at least four cycles (except if you have a 
special sum-addressed memory): add pointer+offset, fetch, operation, store.

All the combinations of offsets, operations, and so on result in thousands 
of possible things you can do, without having actually thousands of 
primitives - this thing needs just *one* more instruction.  I think the 
MiniForth processor also added only one or two instuctions to make locals 
happen.

> The nice thing about working on the MiniForth, was that the hardware
> adapted to me --- I didn't have to adapt to the hardware --- most
> processors are a Procrustean Bed, and the programmer has to contort his
> code to make it fit. With your B16 however, you have only 32 primitives,
> and you lack flexibility in adapting the processor to the programmers'
> needs --- your B16 is still a Procrustean Bed for the programmer.

Oh, just repeating insults?  If I wasn't happy with the b16, I would have 
changed it.  Er, I actually did that...  but not the way you think about it.

> The MiniForth didn't have any support for OOP --- if I had asked for it,
> it may have been possible, but I didn't ask --- then as now I considered
> OOP to be useless in the micro-controller world.

For the sort of things I want to do with the b16, totally agreed.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: OT (slightly) What is the "best" processor for a new project? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-06-16 23:17 -0700
  Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-17 14:19 +0200
    Re: OT (slightly) What is the "best" processor for a new project? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-06-17 16:04 -0700
    Re: OT (slightly) What is the "best" processor for a new project? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-06-17 16:15 -0700
      Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-06-18 00:01 -0400
        Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-19 15:33 +0200
          Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-06-19 17:25 -0400
            Re: OT (slightly) What is the "best" processor for a new project? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-06-19 17:00 -0700
              Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-06-20 18:35 -0400
          Re: OT (slightly) What is the "best" processor for a new project? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-06-19 17:38 -0700
            Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-20 12:51 +0200
              Re: OT (slightly) What is the "best" processor for a new project? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-20 15:28 +0000
              Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-20 18:39 -0700
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-21 14:50 +0200
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-22 18:56 -0700
                Re: OT (slightly) What is the "best" processor for a new project? "WJ" <w_a_x_man@yahoo.com> - 2013-06-23 02:35 +0000
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-22 20:48 -0700
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-23 14:49 +0200
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-26 18:08 -0700
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-27 16:32 +0200
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-30 10:10 -0700
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-06-30 15:18 -0400
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-30 16:01 -0700
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-06-30 20:22 -0400
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-30 21:22 +0200
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-30 15:52 -0700
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-07-01 02:02 +0200
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-30 19:25 -0700
                Re: OT (slightly) What is the "best" processor for a new project? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-01 02:34 -0500
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-07-01 16:26 -0400
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-07-01 23:08 +0200
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-07-01 18:10 -0400
                Re: OT (slightly) What is the "best" processor for a new project? "Elizabeth D. Rather" <erather@forth.com> - 2013-07-01 12:35 -1000
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-07-01 18:42 -0400
                Re: OT (slightly) What is the "best" processor for a new project? "Elizabeth D. Rather" <erather@forth.com> - 2013-07-01 13:03 -1000
                Re: OT (slightly) What is the "best" processor for a new project? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-07-02 07:20 +0000
                Re: OT (slightly) What is the "best" processor for a new project? "Elizabeth D. Rather" <erather@forth.com> - 2013-07-02 07:38 -1000
                Re: OT (slightly) What is the "best" processor for a new project? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-07-02 07:24 +0000
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-07-02 13:02 +0200
                Re: OT (slightly) What is the "best" processor for a new project? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-02 05:58 -0400
                Re: OT (slightly) What is the "best" processor for a new project? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-02 03:34 -0500
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-07-01 20:01 -0700
                Re: OT (slightly) What is the "best" processor for a new project? "WJ" <w_a_x_man@yahoo.com> - 2013-07-02 04:43 +0000
                Re: OT (slightly) What is the "best" processor for a new project? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-02 03:41 -0500
                Re: OT (slightly) What is the "best" processor for a new project? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-02 06:09 -0400
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-07-02 13:51 -0700
                Re: OT (slightly) What is the "best" processor for a new project? daveyrotten <danw8804@gmail.com> - 2013-07-02 14:37 -0700
                Re: OT (slightly) What is the "best" processor for a new project? daveyrotten <danw8804@gmail.com> - 2013-07-02 14:56 -0700
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-07-03 00:30 +0200
                Re: OT (slightly) What is the "best" processor for a new project? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-03 02:19 -0500
                Re: OT (slightly) What is the "best" processor for a new project? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-03 05:18 -0400
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-07-03 18:10 -0700
                Re: OT (slightly) What is the "best" processor for a new project? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-03 05:30 -0400
                Static superinstructions(was: OT (slightly) What is the "best" ...) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-07-03 14:33 +0000
                Re: Static superinstructions(was: OT (slightly) What is the "best" ...) Bernd Paysan <bernd.paysan@gmx.de> - 2013-07-04 00:41 +0200
                Re: Static superinstructions(was: OT (slightly) What is the "best" ...) "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-07 11:32 -0400
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-07-03 18:31 -0700
                Re: OT (slightly) What is the "best" processor for a new project? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-07 11:28 -0400
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-07-02 16:44 -0400
                Re: OT (slightly) What is the "best" processor for a new project? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-02 05:56 -0400
                Re: OT (slightly) What is the "best" processor for a new project? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-02 05:58 -0500
                Re: OT (slightly) What is the "best" processor for a new project? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-03 05:57 -0400
                Re: OT (slightly) What is the "best" processor for a new project? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-03 06:43 -0500
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-06-30 20:29 -0400
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-06-27 10:58 -0400

csiph-web