|
|
Up |
|
|
  |
Author: jackojacko Date: Jul 11, 2006 10:10
Settled on a simpler cache of 2K words and ROM of 4K words to get cache
down to arround 1 sq mm using 0.35u process.
any information on cache cost area yeild trade off vs. hit rate
performance speed up would be appriciated.
at the moment priorities of what goes in 4K ROM is being worked out,
what do people think would be useful?
cheers.
|
| |
|
| | 53 Comments |
|
  |
Author: Paul E. BennettPaul E. Bennett Date: Jul 16, 2006 04:00
rickman wrote:
> I have read a lot here about how important it is to write tight word
> definitions keeping them small and to pay careful attention to how you
> use the stack. I think I found a section of code that I was never
> happy with. In a language like C, I would have not hard a hard time
> writing this code. I would have just used a few conditionals and loops
> and either recursion or some arrays. I don't recall just how much
> testing I have done to the code, but I think it works, I just think it
> was hard to write and is hard to read.
>
> Anyone care to show their stuff and demonstrate how this could have
> been done better?
|
| Show full article (1.74Kb) |
|
| | no comments |
|
  |
Author: rickmanrickman Date: Jul 16, 2006 08:33
Paul E. Bennett wrote:
> rickman wrote:
>
>> I have read a lot here about how important it is to write tight word
>> definitions keeping them small and to pay careful attention to how you
>> use the stack. I think I found a section of code that I was never
>> happy with. In a language like C, I would have not hard a hard time
>> writing this code. I would have just used a few conditionals and loops
>> and either recursion or some arrays. I don't recall just how much
>> testing I have done to the code, but I think it works, I just think it
>> was hard to write and is hard to read.
>>
>> Anyone care to show their stuff and demonstrate how this could have
>> been done better?
>
> Anyone who writes code should have a coding standard which they follow and
> apply consistantly. This is always a good first step to achieving good
> quality code. To ease the burden on the reviewer and tester it may be
> important to publish the intent of the code, which you have done for some
> of the words you posted but not for all. I include the glossary text with ...
|
| Show full article (2.22Kb) |
| no comments |
|
  |
Author: j2thomasj2thomas Date: Jul 16, 2006 12:03
I started looking at the code, getting some idea how it fit together.
Here's a minor thing that jumped out at me:
: rlitnotdone? ( x -- flag) ( return false for bits all the same )
DUP 0= SWAP INVERT 0= OR 0= ;
: rlitnotdone? ( x -- flag) ( return false for bits all the same )
1 -1 WITHIN ;
WITHIN is a cute trick. It works for signed or unsigned numbers, and it
works for any combination of positive or negative numbers.
You define an interval [A B) and do WITHIN.
x A B WITHIN
If x is equal to A or greater than A and less than B , WITHIN consumes
all three and returns true.
If x is outside that range, WITHIN consumes all three and returns
false.
WITHIN is very often useful for testing whether something is within a
range, or outside a range. This time it needs to be outside the range [
-1 0 ]. So I used 1 -1 because the left value is inclusive and the
right value is not. True if it's 1 or above, or -2 or below.
|
| Show full article (4.45Kb) |
| 1 Comment |
|
  |
Author: j2thomasj2thomas Date: Jul 16, 2006 13:11
rickman wrote:
> Paul E. Bennett wrote:
>> If you want a ready-made coding standard, my one at:-
>> You are welcome to adopt this and modify for your own purpose.
> Thanks for the advice, but I'm not certain what you are commenting on.
> Are you saying that my comments are too short and not clear? Or are
> you saying that I missed putting a comment on one of the above words,
> "cntrlitbytes"? Or are you saying that I don't have a consistent style
> of where I put the comment and how I format it?
Independent of any criticism he might have of your code, the link he
provides is likely to be useful. What you get out of it will depend
more how you want to document than on how he wants you to document, so
it might be better to put aside what he wants and just see what you get
out of it. Other people's feedback is good when you're improving
documentation, but first notice what you want to tell them.
|
| Show full article (3.89Kb) |
| no comments |
|
  |
Author: Jerry AvinsJerry Avins Date: Jul 16, 2006 14:40
> WITHIN is a cute trick. It works for signed or unsigned numbers, and it
> works for any combination of positive or negative numbers.
>
> You define an interval [A B) and do WITHIN.
>
> x A B WITHIN
>
> If x is equal to A or greater than A and less than B , WITHIN consumes
> all three and returns true.
>
> If x is outside that range, WITHIN consumes all three and returns
> false.
>
> WITHIN is very often useful for testing whether something is within a
> range, or outside a range. This time it needs to be outside the range [
> -1 0 ]. So I used 1 -1 because the left value is inclusive and the
> right value is not. True if it's 1 or above, or -2 or below.
|
| Show full article (1.25Kb) |
| no comments |
|
  |
Author: rickmanrickman Date: Jul 16, 2006 17:09
> I started looking at the code, getting some idea how it fit together.
>
> Here's a minor thing that jumped out at me:
>
> : rlitnotdone? ( x -- flag) ( return false for bits all the same )
> DUP 0= SWAP INVERT 0= OR 0= ;
>
> : rlitnotdone? ( x -- flag) ( return false for bits all the same )
> 1 -1 WITHIN ;
>
> WITHIN is a cute trick. It works for signed or unsigned numbers, and it
> works for any combination of positive or negative numbers.
>
> You define an interval [A B) and do WITHIN.
>
> x A B WITHIN
>
> If x is equal to A or greater than A and less than B , WITHIN consumes
> all three and returns true. ...
|
| Show full article (9.42Kb) |
| no comments |
|
  |
Author: rickmanrickman Date: Jul 16, 2006 17:24
Jerry Avins wrote:
>> WITHIN is a cute trick. It works for signed or unsigned numbers, and it
>> works for any combination of positive or negative numbers.
>>
>> You define an interval [A B) and do WITHIN.
>>
>> x A B WITHIN
>>
>> If x is equal to A or greater than A and less than B , WITHIN consumes
>> all three and returns true.
>>
>> If x is outside that range, WITHIN consumes all three and returns
>> false.
>>
>> WITHIN is very often useful for testing whether something is within a
>> range, or outside a range. This time it needs to be outside the range [ ...
|
| Show full article (1.79Kb) |
| no comments |
|
  |
Author: rickmanrickman Date: Jul 16, 2006 17:57
> rickman wrote:
>> Paul E. Bennett wrote:
>
>>> If you want a ready-made coding standard, my one at:-
>
>
>>> You are welcome to adopt this and modify for your own purpose.
>
>> Thanks for the advice, but I'm not certain what you are commenting on.
>> Are you saying that my comments are too short and not clear? Or are
>> you saying that I missed putting a comment on one of the above words,
>> "cntrlitbytes"? Or are you saying that I don't have a consistent style
>> of where I put the comment and how I format it?
>
> Independent of any criticism he might have of your code, the link he
> provides is likely to be useful. What you get out of it will depend
> more how you want to document than on how he wants you to document, so
> it might be better to put aside what he wants and just see what you get ...
|
| Show full article (6.09Kb) |
| no comments |
|
  |
|
|
  |
Author: ayrnieuayrnieu Date: Jul 16, 2006 18:49
Jerry Avins wrote:
> A word gaining modern acceptance, BETWEEN, has the stack-effect diagram
> ( n lo-limit hi-limit -- flag ) . Some people think it's more natural.
And if they think so, they have it at this cost:
: BETWEEN 1+ WITHIN ;
I wonder at how many such tiny modifications people have made to basic
Forth words to mitigate minor dissonances.
|
| |
| 1 Comment |
|
RELATED THREADS |
  |
|
|
|
|
|