All of the CHKxxx instructions seem like overkill and wasting transistors and an opcode for something that is probably never on a critical timing path and can easily be done in software.
I was going to suggest that, now that we have hubexec, perhaps these can be moved to the monitor. But as ctwardell suggests these may be for use by the monitor, implying that it's a ROM space saving measure.
About the controversial CHKDEC/CHKHEX/CHKLET/CHKSYM instructions: Of course, these can be done in software, but having instructions handy in PASM will make textual interfaces really simple to code. The logic expense to implement these is less than 0.1% of the silicon.
Today I got the following new instructions implemented:
TOPONE D 'Get top-most '1' bit position in D
TOPZER D 'Get top-most '0' bit position in D
BOTONE D 'Get bottom-most '1' bit position in D
BOTZER D 'Get bottom-most '0' bit position in D
These return D=0..31 and C=0 if a bit was located, or D=0 and C=1 if no target bit existed.
I wanted to get these in before the next release.
I think, at this point, we've got a really rich set of bit, logic, and math ops.
The branching and addressing instructions seem pretty complete, as well, to me. In updating the ROM Monitor, I was able to simplify the heck out the string/table handling because of instructions like LOCPTRA. I don't think it could be any simpler.
We just need to get some USB-helpers and the SERDES done after this next release.
About the controversial CHKDEC/CHKHEX/CHKLET/CHKSYM instructions: Of course, these can be done in software, but having instructions handy in PASM will make textual interfaces really simple to code. The logic expense to implement these is less than 0.1% of the silicon.
Today I got the following new instructions implemented:
TOPONE D 'Get top-most '1' bit position in D
TOPZER D 'Get top-most '0' bit position in D
BOTONE D 'Get bottom-most '1' bit position in D
BOTZER D 'Get bottom-most '0' bit position in D
These return D=0..31 and C=0 if a bit was located, or D=0 and C=1 if no target bit existed.
I wanted to get these in before the next release.
I think, at this point, we've got a really rich set of bit, logic, and math ops.
The branching and addressing instructions seem pretty complete, as well, to me. In updating the ROM Monitor, I was able to simplify the heck out the string/table handling because of instructions like LOCPTRA. I don't think it could be any simpler.
We just need to get some USB-helpers and the SERDES done after this next release.
Those sound quite useful for allocation bitmaps among other things.
In updating the ROM Monitor, I was able to simplify the heck out the string/table handling because of instructions like LOCPTRA. I don't think it could be any simpler.
Did the ROM get smaller, or did you pack more into the ROM area ?
I like all the new instructions that take 4 or 5 or 10 lines of PASM down to one. Even with HUBEXEC, cog RAM is still a valuable commodity. If you are multitasking multiple features into a cog, those saved longs will become important. This was shown with the beauty of SERIN/OUT where you can replace 62 lines of PASM with 4 lines! Yes, it's a lot of new instructions to keep in mind but I think they will get used by the PASM coders.
[H]aving [text] instructions handy in PASM will make textual interfaces really simple to code. The logic expense ... is less than 0.1% of the silicon.
You go, Chip! Text is king! Follow your instinct. No precedent is necessary; blaze a trail. And position that P2 to meet a variety of needs (yes, some of them narrow but cool/useful), making the chip something to be proud of (for all of us in many way). It's a delicate balance you're composing, and it sounds like it's going to be just what the doctor ordered (unless the world needs another "me-too" ARM chip).
You go, Chip! Text is king! Follow you instinct. No precedent is necessary; blaze a trail. And position that P2 to meet a variety of needs (yes, some of them narrow but cool/useful), making the chip something to be proud of (for all of us in many way). It's a delicate balance you're composing, and it sounds like it's going to be just what the doctor ordered (unless the world needs another "me-too" ARM chip).
Watching those UNIX videos that Heater posted reaffirmed to me the significance and beauty of 7-bit ASCII. Some concepts are timeless and may matter forever.
It was providence in the Western world that we had alphabets that could be encoded, along with numerals, in only 6 or 7 (with lowercase) bits. The Chinese would have needed to wait for 16 bit systems to store their characters, plus large memories to hold their bitmaps. That was no place to be bootstrapping from.
FYI The mini I worked on (Friden/Singer/ICL System Ten circa 1969-1980) used 6 bit Ucase ASCII from columns 2-5. To get control characters you used a WriteControl instruction that converted cols 4&5 to cols 0&1. Worked extremely well for the era. Core memory was $$$ at ~$10,000 per 10Kx6bits - ouch!
My mini (yes I owned one) took the length of my garage (a/c etc of course) and had the maximum core memory of 110Kx6b and 3x 10MB H/Disks. we have come a little way since then
FYI The mini I worked on (Friden/Singer/ICL System Ten circa 1969-1980) used 6 bit Ucase ASCII from columns 2-5. To get control characters you used a WriteControl instruction that converted cols 4&5 to cols 0&1. Worked extremely well for the era. Core memory was $$$ at ~$10,000 per 10Kx6bits - ouch!
My mini (yes I owned one) took the length of my garage (a/c etc of course) and had the maximum core memory of 110Kx6b and 3x 10MB H/Disks. we have come a little way since then
Did you acquire that setup 'used'? That would have been more expensive than a house.
Watching those UNIX videos that Heater posted reaffirmed to me the significance and beauty of 7-bit ASCII. Some concepts are timeless and may matter forever.
Seeing that made me happy.
Actually, I'm also reminded of computers where some handy, basic things are built in, usually the ROM, Here, we've packed good ones into instructions.
Did you acquire that setup 'used'? That would have been more expensive than a house.
It was 18mths old when I bought it. Yes it was very expensive. Come to think of it, yes, it was more expensive than my house.
I was writing commercial software for customers as well as developing hardware interfaces to it, so it saved me having to get time on someone else's mini at unreasonable hours. BTW I kept it running until 2000 when I sold it for scrap (gold).
It was 18mths old when I bought it. Yes it was very expensive. Come to think of it, yes, it was more expensive than my house.
I was writing commercial software for customers as well as developing hardware interfaces to it, so it saved me having to get time on someone else's mini at unreasonable hours. BTW I kept it running until 2000 when I sold it for scrap (gold).
That must have been pretty neat. You're used to having fun.
That must have been pretty neat. You're used to having fun.
Yes, it was fun!
You would not believe the similarities between the System Ten and the P1... Dual operand instructions, JMPRET style instruction, all instructions memory to memory, equivalent hub and cog memory, up to 20 cores (but hardware time sliced).
I've got the FPGA compiling well now with all the new instructions and new ROM. I just need to get the docs updated to get the next release done. This has taken longer than I thought it would.
I have a question for you all:
In contemplating that each Prop2 will connect to an 8-pin SPI flash chip that it can boot from, and that these chips provide 8MB for under $1, or 16MB for less than $2, we effectively have a local solid-state drive that holds 32x or 64x the RAM of the Prop2. This amount of memory warrants a FAT scheme, so that actual files, aside from just boot data, can be realized. Is there any reason to stick with some standard FAT system for an application like this, where the media is not removable? Couldn't we make up our own FAT scheme and then have simple utilities to shuttle files between the Prop2 and larger systems?
I'm just realizing that this issue ought to be addressed so that we'll have a common basis for file storage in that 8-pin Flash chip.
If we do this right, we should have a significant basis for UNIX-like operability - in the original sense of the concept.
I've got the FPGA compiling well now with all the new instructions and new ROM. I just need to get the docs updated to get the next release done. This has taken longer than I thought it would.
I have a question for you all:
In contemplating that each Prop2 will connect to an 8-pin SPI flash chip that it can boot from, and that these chips provide 8MB for under $1, or 16MB for less than $2, we effectively have a local solid-state drive that holds 32x or 64x the RAM of the Prop2. This amount of memory warrants a FAT scheme, so that actual files, aside from just boot data, can be realized. Is there any reason to stick with some standard FAT system for an application like this, where the media is not removable? Couldn't we make up our own FAT scheme and then have simple utilities to shuttle files between the Prop2 and larger systems?
I'm just realizing that this issue ought to be addressed so that we'll have a common basis for file storage in that 8-pin Flash chip.
However flash fs's have to be somewhat different than FAT for two reasons:
1) minimum erase grain is 4K, so "clusters" should be 4K in size
2) it is possible to write '0' bits to '1' bits in existing sectors
Possibly a modified version of the minix file system would be good.
p.s.
I have written a NOR-flash-optimized Unix like filesystem for my projects, however I cannot open source it as wifey would kill me if I gave away man-months of work.
I've got the FPGA compiling well now with all the new instructions and new ROM. I just need to get the docs updated to get the next release done. This has taken longer than I thought it would.
I have a question for you all:
In contemplating that each Prop2 will connect to an 8-pin SPI flash chip that it can boot from, and that these chips provide 8MB for under $1, or 16MB for less than $2, we effectively have a local solid-state drive that holds 32x or 64x the RAM of the Prop2. This amount of memory warrants a FAT scheme, so that actual files, aside from just boot data, can be realized. Is there any reason to stick with some standard FAT system for an application like this, where the media is not removable? Couldn't we make up our own FAT scheme and then have simple utilities to shuttle files between the Prop2 and larger systems?
I'm just realizing that this issue ought to be addressed so that we'll have a common basis for file storage in that 8-pin Flash chip.
If we do this right, we should have a significant basis for UNIX-like operability - in the original sense of the concept.
Flash file systems normally don't use the FAT standard because of the requirements of the flash chip, which are the limited number of writes that can be done to a block and the fact that a block must be erased to change a value in it. A flash file system must provide a method for wear leveling. The only flash file system I'm familiar with used a linear file system where files are written linearly one after another, and the file name and attributes are written contiguous with the file's contents. When a file is changed, its original version is deleted by clearing a bit in its file descriptor, and writing the new version of the file at the end of the string.
A file system like this will eventually fill up the flash chip with lots of deleted files, so a reclaim operation must be done at some point to eliminate the deleted files and compact the file system. Some file systems partition the flash into two halves, and perform the reclaim into the unused half, and then switch over to that half after the reclaim is completed. This allows for the reclaim to run in the background, and also allows for recovering if the reclaim fails.
It would be nice to have code for a flash file system that everybody could use, but I don't think there's an immediate need for this. However, it would be nice to have one even for P1 boards that contain flash.
In contemplating that each Prop2 will connect to an 8-pin SPI flash chip that it can boot from, ...
I could see and advantage to use a FAT scheme: in the case that someone makes an adapter between SPI and USB mass storage (PENDRIVE) or any other kind of mass storage (MMC, Compact Flash, IDE/ATA, SATA, etc ...).
Imagine a USB pendrive with a selectable interface: USB or SPI ( USB <=> Flash <=> SPI ). I think this can be easily done with current commercial usb controllers (if there is anyone that can use serial SPI) by adding just a multiplexer. Or even better, a DUAL PORT mass storage !
Flash file systems normally don't use the FAT standard because of the requirements of the flash chip, which are the limited number of writes that can be done to a block and the fact that a block must be erased to change a value in it. A flash file system must provide a method for wear leveling. The only flash file system I'm familiar with used a linear file system where files are written linearly one after another, and the file name and attributes are written contiguous with the file's contents. When a file is changed, its original version is deleted by clearing a bit in its file descriptor, and writing the new version of the file at the end of the string.
A file system like this will eventually fill up the flash chip with lots of deleted file, so a reclaim operation must be done at some point to eliminate the deleted files and compact the file system. Some file systems partition the flash into two halves, and perform the reclaim into the unused half, and then switch over to that half after the reclaim is completed. This allows for the reclaim to run in the background, and also allows for recovering if the reclaim fails.
It would be nice to have code for a flash file system that everybody could use, but I don't think there's an immediate need for this. However, it would be nice to have one even for P1 boards that contain flash.
I could see and advantage to use a FAT scheme: in the case that someone makes an adapter between SPI and USB mass storage (PENDRIVE) or any other kind of mass storage (MMC, Compact Flash, IDE/ATA, SATA, etc ...).
Imagine a USB pendrive with a selectable interface: USB or SPI ( USB <=> Flash <=> SPI ). I think this can be easily done with current commercial usb controllers (if there is anyone that can use serial SPI) by adding just a multiplexer. Or even better, a DUAL PORT mass storage !
FAT would wear out a flash chip spectacularly quickly.
That is the reason that I talked about a BRIDGE between mass storage (eMMC, SD, CF, whatever) and SPI. With this bridge you don't need to worry about wear leveling or ECC correction, they already have a controller integrated.
The BRIDGE between this and SPI can be made with some new microcontrollers with integrated high speed storage (Cortex-M3, AVR, PIC) or even with CPLD/FPGA.
1. Does it make sense to socket the flash device? They will get worn out.
2. Is another type of device possible / practical?
3. What needs to be on chip, if anything? (ROM)
I'm inclined toward keeping the ROM small, meaning simple, really simple FS, if any.
4. How does this relate to on chip development?
It also seems to me, the whole works can be on a formatted flash. How practical is this related to storage? Having a flash device setup to offer development seems a no brainer. It's the product of it I wonder about. Having alternative storage, which can be as simple as, "dump to terminal" would get data out to just about anything.
There is no way to make memory cards as cheaply as SD cards and USB flash bought from Asia, so any new memory card would cost more - and therefore sell only in tiny numbers (if that).
Since it would not sell, there is no point in designing/building them.
For P2, there is sense in making a simple file system for the boot flash, but it makes no sense to make it FAT as that would wear out the flash extremely quickly.
Something like the minix file system, modified for 4k blocks and wear leveling, would work reasonably well.
Using a bridge microcontroller would only add to the costs and increase development time.
For the P2, we should leverage off cheap SD cards, and add a simple file system to the boot flash. Making new bridge devices, programming them etc does not make sense economically. As a hobby project it would be interesting, however BOM costs prohibit using such a bridge design on the vast majority of P2 boards that will be built.
That is the reason that I talked about a BRIDGE between mass storage (eMMC, SD, CF, whatever) and SPI. With this bridge you don't need to worry about wear leveling or ECC correction, they already have a controller integrated.
The BRIDGE between this and SPI can be made with some new microcontrollers with integrated high speed storage (Cortex-M3, AVR, PIC) or even with CPLD/FPGA.
1: yes, or at least .05" spacing SOIC8 (fairly easy to replace)
2: NAND flash, but more expensive, needs more pins
3: first X KB on flash is like /boot, fixed area at the front, then loads rest from simple file system, yep keep ROM KISS
4: makes it easier, as long as FS has enough features (need directories, do not really need various time stamps)
The chips can be queried as to capacity.
Biggest item to keep in mind is 4K is the minimum erase grain.
Keep wear leveling in mind.
In the past I had 'fsck' reclaim deleted 4k sectors.
KISS principle. Needs only MINIMUM required functionality, does not need to clone FAT / extfs / existing FS.
1. Does it make sense to socket the flash device? They will get worn out.
2. Is another type of device possible / practical?
3. What needs to be on chip, if anything? (ROM)
I'm inclined toward keeping the ROM small, meaning simple, really simple FS, if any.
4. How does this relate to on chip development?
It also seems to me, the whole works can be on a formatted flash. How practical is this related to storage? Having a flash device setup to offer development seems a no brainer. It's the product of it I wonder about. Having alternative storage, which can be as simple as, "dump to terminal" would get data out to just about anything.
Comments
I was going to suggest that, now that we have hubexec, perhaps these can be moved to the monitor. But as ctwardell suggests these may be for use by the monitor, implying that it's a ROM space saving measure.
Not all interpreters. Only for languages that define "symbol" the same way CHKSYM does.
Today I got the following new instructions implemented:
TOPONE D 'Get top-most '1' bit position in D
TOPZER D 'Get top-most '0' bit position in D
BOTONE D 'Get bottom-most '1' bit position in D
BOTZER D 'Get bottom-most '0' bit position in D
These return D=0..31 and C=0 if a bit was located, or D=0 and C=1 if no target bit existed.
I wanted to get these in before the next release.
I think, at this point, we've got a really rich set of bit, logic, and math ops.
The branching and addressing instructions seem pretty complete, as well, to me. In updating the ROM Monitor, I was able to simplify the heck out the string/table handling because of instructions like LOCPTRA. I don't think it could be any simpler.
We just need to get some USB-helpers and the SERDES done after this next release.
Did the ROM get smaller, or did you pack more into the ROM area ?
The ROM still ends at $DFF, but the ROM Monitor is slightly enhanced. There are several longs free now.
You go, Chip! Text is king! Follow your instinct. No precedent is necessary; blaze a trail. And position that P2 to meet a variety of needs (yes, some of them narrow but cool/useful), making the chip something to be proud of (for all of us in many way). It's a delicate balance you're composing, and it sounds like it's going to be just what the doctor ordered (unless the world needs another "me-too" ARM chip).
Watching those UNIX videos that Heater posted reaffirmed to me the significance and beauty of 7-bit ASCII. Some concepts are timeless and may matter forever.
It was providence in the Western world that we had alphabets that could be encoded, along with numerals, in only 6 or 7 (with lowercase) bits. The Chinese would have needed to wait for 16 bit systems to store their characters, plus large memories to hold their bitmaps. That was no place to be bootstrapping from.
My mini (yes I owned one) took the length of my garage (a/c etc of course) and had the maximum core memory of 110Kx6b and 3x 10MB H/Disks. we have come a little way since then
Did you acquire that setup 'used'? That would have been more expensive than a house.
Seeing that made me happy.
Actually, I'm also reminded of computers where some handy, basic things are built in, usually the ROM, Here, we've packed good ones into instructions.
I was writing commercial software for customers as well as developing hardware interfaces to it, so it saved me having to get time on someone else's mini at unreasonable hours. BTW I kept it running until 2000 when I sold it for scrap (gold).
Actually the first ones I saw were on teletype machines as used by telecoms to enter telegrams. Oooh - is my age showing
That must have been pretty neat. You're used to having fun.
You would not believe the similarities between the System Ten and the P1... Dual operand instructions, JMPRET style instruction, all instructions memory to memory, equivalent hub and cog memory, up to 20 cores (but hardware time sliced).
I have a question for you all:
In contemplating that each Prop2 will connect to an 8-pin SPI flash chip that it can boot from, and that these chips provide 8MB for under $1, or 16MB for less than $2, we effectively have a local solid-state drive that holds 32x or 64x the RAM of the Prop2. This amount of memory warrants a FAT scheme, so that actual files, aside from just boot data, can be realized. Is there any reason to stick with some standard FAT system for an application like this, where the media is not removable? Couldn't we make up our own FAT scheme and then have simple utilities to shuttle files between the Prop2 and larger systems?
I'm just realizing that this issue ought to be addressed so that we'll have a common basis for file storage in that 8-pin Flash chip.
If we do this right, we should have a significant basis for UNIX-like operability - in the original sense of the concept.
That possibility can we test on new update.
However flash fs's have to be somewhat different than FAT for two reasons:
1) minimum erase grain is 4K, so "clusters" should be 4K in size
2) it is possible to write '0' bits to '1' bits in existing sectors
Possibly a modified version of the minix file system would be good.
p.s.
I have written a NOR-flash-optimized Unix like filesystem for my projects, however I cannot open source it as wifey would kill me if I gave away man-months of work.
A file system like this will eventually fill up the flash chip with lots of deleted files, so a reclaim operation must be done at some point to eliminate the deleted files and compact the file system. Some file systems partition the flash into two halves, and perform the reclaim into the unused half, and then switch over to that half after the reclaim is completed. This allows for the reclaim to run in the background, and also allows for recovering if the reclaim fails.
It would be nice to have code for a flash file system that everybody could use, but I don't think there's an immediate need for this. However, it would be nice to have one even for P1 boards that contain flash.
I could see and advantage to use a FAT scheme: in the case that someone makes an adapter between SPI and USB mass storage (PENDRIVE) or any other kind of mass storage (MMC, Compact Flash, IDE/ATA, SATA, etc ...).
Imagine a USB pendrive with a selectable interface: USB or SPI ( USB <=> Flash <=> SPI ). I think this can be easily done with current commercial usb controllers (if there is anyone that can use serial SPI) by adding just a multiplexer. Or even better, a DUAL PORT mass storage !
FAT would wear out a flash chip spectacularly quickly.
I went through this exercise years ago, and wrote my own flash fs (with wear leveling, etc).
Here are some links on flash file systems:
http://en.wikipedia.org/wiki/Flash_file_system
http://en.wikipedia.org/wiki/F2FS
http://www.linux.org/threads/flash-friendly-file-system-f2fs.4477/
http://www.yaffs.net/
http://www.ibm.com/developerworks/library/l-flash-filesystems/
http://www.spansion.com/Support/Pages/DriversSoftware.aspx
Yes, there is no interest in giving cheap, mass storage, high speed and easy to implement protocol to the masses.
So you are right, actually is not as easy as using just a multiplexer.
This reminds me a thread I started about how to get a huge storage, with high speed and free: http://forums.parallax.com/showthread.php/151150-Add-on-card-for-IDE-Drive-to-P2-DE0-nano.-Any-interest
That is the reason that I talked about a BRIDGE between mass storage (eMMC, SD, CF, whatever) and SPI. With this bridge you don't need to worry about wear leveling or ECC correction, they already have a controller integrated.
The BRIDGE between this and SPI can be made with some new microcontrollers with integrated high speed storage (Cortex-M3, AVR, PIC) or even with CPLD/FPGA.
[1] http://www.linkedin.com/groups/SPI-mode-in-eMMC-Devices-37565.S.77338175
[2] http://www.toshiba-components.com/memory/emmc.html
[3] http://www.latticesemi.com/~/media/Documents/ReferenceDesigns/SZ/SPIFlashControllerwithWearLeveling.PDF
1. Does it make sense to socket the flash device? They will get worn out.
2. Is another type of device possible / practical?
3. What needs to be on chip, if anything? (ROM)
I'm inclined toward keeping the ROM small, meaning simple, really simple FS, if any.
4. How does this relate to on chip development?
It also seems to me, the whole works can be on a formatted flash. How practical is this related to storage? Having a flash device setup to offer development seems a no brainer. It's the product of it I wonder about. Having alternative storage, which can be as simple as, "dump to terminal" would get data out to just about anything.
Since it would not sell, there is no point in designing/building them.
For P2, there is sense in making a simple file system for the boot flash, but it makes no sense to make it FAT as that would wear out the flash extremely quickly.
Something like the minix file system, modified for 4k blocks and wear leveling, would work reasonably well.
Using a bridge microcontroller would only add to the costs and increase development time.
For the P2, we should leverage off cheap SD cards, and add a simple file system to the boot flash. Making new bridge devices, programming them etc does not make sense economically. As a hobby project it would be interesting, however BOM costs prohibit using such a bridge design on the vast majority of P2 boards that will be built.
2: NAND flash, but more expensive, needs more pins
3: first X KB on flash is like /boot, fixed area at the front, then loads rest from simple file system, yep keep ROM KISS
4: makes it easier, as long as FS has enough features (need directories, do not really need various time stamps)
The chips can be queried as to capacity.
Biggest item to keep in mind is 4K is the minimum erase grain.
Keep wear leveling in mind.
In the past I had 'fsck' reclaim deleted 4k sectors.
KISS principle. Needs only MINIMUM required functionality, does not need to clone FAT / extfs / existing FS.
I don't think any of this should be in the P2 ROM.
Too many things pulling Chip in too many ways and being in the ROM puts it on the critical path.
IMHO the file system should be part of the code initially loaded from the FLASH chip using the P2 current boot mechanism.
C.W.
The rom should know enough to pull a second stage boot loader from flash. That's all. (that was the like /boot reference in my reply above)
That way we can have different second stage boot loaders for SD cards, flash fs, rotating magnetic drum memory, paper tape, punched cards, etc.