The time for the P2 is now!
Seairth
Posts: 2,474
in Propeller 2
I just read the announcement of the Arduino Vidor 4000, which is a new (not yet released) offering from Arduino that combines an ARM and an FPGA. We've discussed where P2's potential market is, and this announcement couldn't come at a better time. It shows that others also realize the importance of providing FPGA-like capabilities with an easy-to-use interface. People will flock to this product (because Arduino), then realize just how complicated the whole thing really is for anything non-trivial. They will start looking for a simpler solution, and this is where the P2 will shine.
Comments
The FPGA contains 16K Logic Elements, 504Kbit of embedded RAM and 56 18x18 bit HW multipliers for high-speed DSP;"
Looks suitable for P1V hosting - one blog claims "It’ll be out next month (June 2018) for about $60 USD."
There is also this new Ardunio
https://store.arduino.cc/usa/arduino-uno-wifi-rev2
https://www10.edacafe.com/nbc/articles/1/1587631/Tachyum-Unveils-World-1st-Universal-Processor-Platform-with-More-than-10x-Performance-Conventional-Processors
but very few actual details...
(tho it sounds like Tachyon would run very fast on Tachyum )
Meanwhile, the ARM + FPGA thing is going to involve gigabytes of installs that take minutes to run each time on a big host system. And no one will ever be able to understand the last detail of it all. Average user probably achieves 2% knowledge of what's going on.
Well, you could.
I wish you would, Mparc is visible again, his Spinx was almost there on a P1.
But first get Spin2 running, and OpenSpin2 and GCC...
Enjoy
Mike
And not 'C'.
The thing about Arduino is that it's a complete ecosystem not just a board or IDE. It's a variety of computing platforms, using many different processors, on which you run code written is the most universal programming language (C) in an IDE which hides all the ugly details, including the target processor. Onto that platform you plug your IO boards (shields) which all come with a load of example programs. And the 'net is awash with other sample (working) code.
A P2 on an Arduino format board, with the necessary BSP (board support package) and GCC compiler with well thought out support for multiple cores might work. Otherwise it's just another not-an-Arduino and not-an-ARM development board.
That is a wonderful board. Problem is it does not follow through, there is no support for it in the Arduino IDE. Also the price is a bit steep!
Edit: I seem to recall somebody made an Arduino support library for the ASC.
However, I think it'll be a lot easier to have a "native" compiler and editor on the P2 than P1. It'll still be tricky to make applications that use all of the P2's memory in that setup, since it will have to be made in pieces and linked or chain loaded.
Also, I think for the native on P2 compiler, you'll want to have it be split into compiling and linking at the very least, if not also splitting out PASM assembling. The limited memory available on chip make the whole do it all together method even more problematic since that uses tons more memory during compiling. At least with things split apart you have a chance of making decent sized applications within the limited memory.
As for Arduino, Brian is right, C is one of the keys. You can dismiss it all you want, but the reality is that the world uses C. So, it doesn't matter how nice you make things on P2, if it's Spin/PASM it's foreign and a hard sell.
C compilers and others ran on 8 bit CP/M machines with 64K of RAM. That's how the first and only C compiler that ran on a P1 worked. See ZiCog BDSC.
Surely some skillful sould could get TCC working on a P.
I was just replying to Chip saying he could make a complete IDE in 32K. I think it'll take more like 64-128K.
I, also, think it's feasible to have a C compiler native to the P2, not so sure about C++ really, maybe an older flavor without templates and all the new "modern C++" features.
We already have some high level languages for the P2. Dave Hein got GCC working; it's incomplete, but usable. Tachyon, of course, is built into the ROM. And Spin for P2 exists now, in the form of fastspin + spin2gui.
It's no fun configuring an FPGA with the gigantic and massively slow and complex Quartus IDE. Not many are going to get into learning anything with that.
I imagine the idea is that some gurus will work up useful FPGA configurations that get magically loaded to the FPGA when one includes the required "sketch" that interfaces to it from ones software.
I'm not sure why it needs the crypto chip, can't you put the crypto engine into the FPGA?
They could have done something a lot more fun and interesting, especially for beginners:
1) Use a Lattice ICE FPGA. Much small, cheaper, simpler and lower power. This is for an IoT thing right?
2) Use the Yosys tools to synthesize and load designs for the FPGA. Very small, quick and simple to use. Open Source to boot!
3) Perhaps add Verilog syntax highlighting and other support into the Arduino IDE.
4) Probably be helpful to integrate Icarus or Verilator simulators so that people can get an even quicker turn around on their HDL coding efforts.
Yes, the Lattice parts are probably have much less logic than the Cyclone but plenty enough for people learning Verilog for the first time. Big enough to put an 32 bit processor in there, they could have stuck with the ATMEGA and used a RISC V core in the FPGA instead!
I'm not into the Arduino thing at all but I suspect the Arduino IDE is just fine for beginners. Last time I looked at it, years ago, it was very quick and simple. Just what a beginner needs.
I don't call the language used to program Arduinos "C". I call it "C++". Because that is what it is. The Arduino uses the same GCC as the Propeller, Linux and everything else.
Certainly you don't get the C standard library or STL with the Arduino IDE. For very good reason. The 8 bit ATMEGA does not have enough memory space to put it! Same restriction as all other little micro-controllers.
PWM is a perfectly fine way to get an analog output. Like the speaker and headphone drivers on your phone, laptop, whatever sound system you have now a days.
Hi heater,
I agree that the Arduino is fine for beginners. However, it is only useful as a stepping stone. I cringe when I see a "serious" project that has an Arduino in it. This is not learning electronics as much at it is not learning how to program. I used to do my programming in Euphoria, until I've discovered that C was not hard at all. In that sense, I really encourage people to leave Arduino behind and start programming micro-controllers.
Regarding if it is C or C++, I don't entirely agree. You may write your function as "void function()" instead of "void function(void)", but I don't see any OO programming in it. Where are the classes? Where is the polymorphism? Perhaps it is neither C or C++, as it is not conformant to any of the standards. Lets call it a C like language.
As for the analog output function, it could be renamed as "PWM" or something. It would be a bit more transparent. Also, calling the program a "sketch" is not my thing.
Kind regards, Samuel Lourenço
Maybe you're right but Brian was asking for GCC I think P2 will need as Brian put it "and GCC compiler with well thought out support for multiple cores might work."
I thought everybody hates Spin, but most of all Forth
Funny thing though, is that when you are busy just doing stuff, you are too busy loving it to be hating something else, since it doesn't bother you, but it seems to bother everybody else.
Arduino supports C++ classes and their associated functionality. You (usually) put your main() function in the .ino file, and then you put each class in its own .cpp file with a corresponding .h file header. The Arduino loads all the .cpp and .h files in the same folder as the .ino file automatically and puts a set of tabs, similar to a browser, along the top to access each file. The ide supports the creation of new class files and headers - click the little down arrow thing over at the top right of the IDE window. Classes are the mechanism that most of the Arduino libraries use: when you put something like #include <Servo.h> there are C++ classes behind the scenes doing most of the work. Of course, you can view and modify these files yourself if you wish, but they are not automatically displayed to avoid intimidating newbies.
I don't follow you. If someone solves a problem with an Arduino, then if it works, if it is reliable and cheap, if it was quick and easy to develop, then it's as good as any "professional" solution crafted with hand coded assembler by a CS graduate and running on a custom microcontroller board.
Stepping stones are good. My first introduction to programming was in BASIC, via a teletype to some far away mainframe. It was magical and inspiring. As was the case for millions of kids years later with their C64s, Sinclair Spectrums and so on. And I assume is the case for kids flashing LEDS or getting simple bots to work with Arduino today, or those using the Raspberry Pi.
Sure 99% of them may never get off that first stepping stone. That's OK. Hopefully they had some fun and learned a little something even if programming ends up not being their "thing".
As for C vs C++ in the Arduino: The "Hello World" program for the Arduino, from the Arduino web site looks like this: That is OOP. You can't do "lcd.print(...)" etc in C. Have a look at LiquidCrystal.h to see where the class is:
https://github.com/arduino-libraries/LiquidCrystal/blob/master/src/LiquidCrystal.h
Which inherits from Print.
It is fully conformant to some version of the C++ standard or other. (Excluding all the STL and stdlib stuff as noted above)
I agree, I hate the terminology of "sketch" etc.
I have come to a realization. Most of us have our preferences and reasons. They are very highly distinctive.
In addition, the P2 is a bit of a fresh playground. How it works is odd, or highly differentiated from how a lot of other systems work. Pick one, depending on perspective.
There is more than a bit of, "If I were king and could do it all over again..." in play. Given the nature of this project, that is to be expected, is it not?
Nobody knows how "the masses" will use this device. We all know how we intend or can see it being used.
Many of us have our reasons for doing things right now, and the nature of all this speaks to that too. Same way.
I, for one, am very interested in FastSpin. Eric is making good progress and offering common sense, lean "in the spirit of spin" features that appear well matched to P2.
Several here appear interested in TAQOS. I saw, "paste this file for..." and think to myself, "That right there is where Forth can crush it." People can benefit and use the tool without having to become expert.
I didnt quite see that coming, though I should have given I've written, "throw a dictionary at it" numerous times. Seeing that play out is very intriguing.
I'm about done with business travel and can play for reals. Can't wait.
About that realization:
Passion. At this early stage, making tools is expensive. That cost is either dollars and time, or it's time and passion, or drive of some sort.
Based on what I saw before, getting gcc onto P2 is a heavy lift. It's not so much hating C, though some do, and that is OK. It's that nobody has the combination of passion, skill, time to advance that cause. Dollars aren't there right now either.
It's a heavier lift than many of our current tool efforts are.
Seems to me, running on passion, right now, to get this thing through the gate, makes a lot of sense. And that's true mostly because there aren't other options on the table right now.
So. It may just have to go the P1 way. We got what we got, and people run with it. Should interest grow, perhaps that combination of passion and or dollars will present itself. I think it will. I think that because the capability is going to prove compelling.
Until more people care, and that takes real product out there more than anything, and it takes that product working too, what we got is pretty awesome, and it is a serious commit to something we just don't know will work.
I believe it will. I'm sure we all do. But, translating that into the means needed for something like gcc is a stiff wager.
Seems to me, placing that bet post risk is necessary.
I think broad acceptance includes C. Any acceptance beyond this group of passionate people takes real chips too.
Anyway, some perspective worth what you paid.
And I respect their opinions.
However, without proper C support sales of the P2 will be 1% of what they would be with a decent, manufacturer supported, C tool chain.
We can argue all day about my prediction : time will prove one of us right.
Surely you cannot have missed all the language war thread that have broken out here over the years? Did you miss the infamous, now sunk, Official Javascript Religious War Thread?
https://forums.parallax.com/discussion/152201/the-official-javascript-religious-war-thread/p1
Not to mention all the interminable debates about language choice that go on wherever programmers gather on the net.
Not to mention the editor wars. The command line vs IDE factions. The operating system battles. Or RISC vs CISC camps.
Then there is the extreme minutia of source code formatting styles, commenting styles, tabs or spaces, what kind of line end character to use.
What about the GOTO wars!
Grief, it's endless.
My observation is that: Programmers like to think they are rational, logical beings. Which of course they are in large part. Else they would never get anything to work. But they have preferences that they will defend to the death for purely emotional reasons. All the while inventing all manner of reasons as to why their choice is the only rational one!
For example:
When high level languages came on the scheme the old guard of assembler programmers dissed them. We had to wait for those guys to die off before high level languages took over.
Then there is the GOTO. Old school programmers will come up with all kind of reasons why GOTO is essential.
Me, I want C and C++. Because it's a standard, because it's performant, because it's cross-platform.
I want Javascript. Because it's a standard, because it's dead easy when perhaps hyper-performance is not critical (besides we have extra cogs to do the fast bits), because it's cross-platform.
There. See how rational I am
Bootstrapping gcc is enough of a lift that it makes the most sense once working devices are a reality.
Whilst I'm dreaming of C and Javascript, the Forth guys are rolling up their sleeves and getting solutions working. Hats off to them for that.
I'll continue plugging away on p2gcc. I plan on cleaning up how data sections are handled. Currently, global data is a real kludge. I also plan on integrating P1's PropGCC library code into p2gcc. I wrote a minimal math library several months ago that supports floating point, but I haven't integrated it yet. p2gcc will support C++ once I port the relevant library code from P1 PropGCC.
At some point Parallax needs to fund a GCC project for the P2 like they did for the P1. I think C/C++ is essential for the P2 to be a success.