From: "Marc Van Riet" Newsgroups: comp.arch.fpga Subject: GNU C for custom processor Date: Wed, 29 Jan 2003 01:01:08 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Lines: 28 Message-ID: <3e35c83e$0$27955$ba620e4c@news.skynet.be> Organization: -= Skynet Usenet Service =- NNTP-Posting-Host: 217.136.53.101 X-Trace: 1043712062 reader0.news.skynet.be 27955 217.136.53.101:1073 X-Complaints-To: abuse@skynet.be Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news.imp.ch!news.imp.ch!newsfeed.vmunix.org!feed.news.nacamar.de!newsfeed.online.be!skynet.be!skynet.be!louie!not-for-mail Xref: chonsp.franklin.ch comp.arch.fpga:25349 Hi, I'm writing a small processor core as a hobby. It is a small 16-bit core with about 20 instructions, including simple ALU functions, memory read and writes, stack operations, ... All instructions can be conditional (depending on the value of my 'working register'). Up to three operations can be combined in a single opcode, although not all combinations are possible. I was wondering if it would be do-able for me to port the GNU C-compiler to my own core. I guess it is possible, since the ARM has conditional instructions too, and it has multiple instructions in one opcode too. But how long would that take me ? Anybody any experience in porting GNU-C to a similar core as mine ? Are there any alternatives ? The LCC compiler isn't an option I think, because their original target core doesn't have multiple-instructions or conditional code. Any comments are appreciated, Marc ###### From: "Ralph Mason" Newsgroups: comp.arch.fpga References: <3e35c83e$0$27955$ba620e4c@news.skynet.be> Subject: Re: GNU C for custom processor Lines: 49 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: Date: Tue, 28 Jan 2003 16:35:27 +1300 NNTP-Posting-Host: 210.86.63.105 X-Complaints-To: newsadmin@xtra.co.nz X-Trace: news.xtra.co.nz 1043725067 210.86.63.105 (Tue, 28 Jan 2003 16:37:47 NZDT) NNTP-Posting-Date: Tue, 28 Jan 2003 16:37:47 NZDT Organization: Xtra Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news.mailgate.org!enews.sgi.com!news.xtra.co.nz!53ab2750!not-for-mail Xref: chonsp.franklin.ch comp.arch.fpga:25336 I don't really know about porting GCC. But have a suggestion. If you architecture is such that you can take sequential instruction and execute them together, perhaps you could just produce your own assembler that takes a sequential program for your architecture and do a simple optimization there using a simple look ahead to decide which instructions can be executed in parallel, so it's completely the assembler that makes that optimizations. This would perhaps let you use lcc if you wanted, and you get a 'free' assembler as a bonus! Ralph "Marc Van Riet" wrote in message news:3e35c83e$0$27955$ba620e4c@news.skynet.be... > Hi, > > I'm writing a small processor core as a hobby. It is a small 16-bit core > with about 20 instructions, including simple ALU functions, memory read and > writes, stack operations, ... All instructions can be conditional > (depending on the value of my 'working register'). Up to three operations > can be combined in a single opcode, although not all combinations are > possible. > > I was wondering if it would be do-able for me to port the GNU C-compiler to > my own core. I guess it is possible, since the ARM has conditional > instructions too, and it has multiple instructions in one opcode too. > > But how long would that take me ? Anybody any experience in porting GNU-C to > a similar core as mine ? > > Are there any alternatives ? The LCC compiler isn't an option I think, > because their original target core doesn't have multiple-instructions or > conditional code. > > Any comments are appreciated, > Marc > > > > > > ###### From: "Jonathan Bromley" Newsgroups: comp.arch.fpga Subject: Re: GNU C for custom processor Date: Tue, 28 Jan 2003 08:57:39 -0000 Lines: 26 Message-ID: References: <3e35c83e$0$27955$ba620e4c@news.skynet.be> Reply-To: "Jonathan Bromley" NNTP-Posting-Host: 62.49.79.188 X-Trace: news.demon.co.uk 1043744260 21686 62.49.79.188 (28 Jan 2003 08:57:40 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 28 Jan 2003 08:57:40 +0000 (UTC) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news.mailgate.org!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail Xref: chonsp.franklin.ch comp.arch.fpga:25351 "Marc Van Riet" wrote > I was wondering if it would be do-able for me to port the GNU C-compiler to > my own core. I guess it is possible, since the ARM has conditional > instructions too, and it has multiple instructions in one opcode too. GCC's back end is very flexible and can be re-targeted to just about anything. However, if you're asking this on comp.arch.fpga (rather than one of the compiler groups) then I think it's likely that your chances of actually doing it yourself within one lifetime are about the same as mine. Think paper cats and burning barns. -- Jonathan Bromley, Consultant DOULOS - Developing Design Know-how VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project Services Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK Tel: +44 (0)1425 471223 mail: jonathan.bromley@doulos.com Fax: +44 (0)1425 471573 Web: http://www.doulos.com The contents of this message may contain personal views which are not the views of Doulos Ltd., unless specifically stated. ###### From: "Alan Fitch" Newsgroups: comp.arch.fpga Subject: Re: GNU C for custom processor Date: Tue, 28 Jan 2003 11:53:17 -0000 Lines: 43 Message-ID: References: <3e35c83e$0$27955$ba620e4c@news.skynet.be> NNTP-Posting-Host: 62.49.79.188 X-Trace: news.demon.co.uk 1043754801 6105 62.49.79.188 (28 Jan 2003 11:53:21 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 28 Jan 2003 11:53:21 +0000 (UTC) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Priority: 3 X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MSMail-Priority: Normal Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news.mailgate.org!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!peer1.news.newnet.co.uk!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail Xref: chonsp.franklin.ch comp.arch.fpga:25356 "Jonathan Bromley" wrote in message news:b15gm3$l5m$1$8300dec7@news.demon.co.uk... > "Marc Van Riet" wrote > > I was wondering if it would be do-able for me to port the GNU C-compiler > to > > my own core. I guess it is possible, since the ARM has conditional > > instructions too, and it has multiple instructions in one opcode too. > Have you looked at lcc? It's a C compiler generator. Have a look at the Gray Research web-site, and the XR16 processor etc. Jan Gray used lcc to create a C compiler for his processor, regards Alan -- Alan Fitch HDL Consultant DOULOS - Developing Design Know-how VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project Services Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK Tel: +44 (0)1425 471223 mail: alan.fitch@doulos.com Fax: +44 (0)1425 471573 Web: http://www.doulos.com The contents of this message may contain personal views which are not the views of Doulos Ltd., unless specifically stated. ###### From: dimmy Newsgroups: comp.arch.fpga Subject: Re: GNU C for custom processor Date: Tue, 28 Jan 2003 17:26:01 +0300 Organization: eis Lines: 44 Message-ID: References: <3e35c83e$0$27955$ba620e4c@news.skynet.be> Reply-To: diwil@eis.ru NNTP-Posting-Host: ip88-74.adsl.wplus.ru Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.wplus.spb.ru 1043764235 19381 195.131.88.74 (28 Jan 2003 14:30:34 GMT) X-Complaints-To: usenet@news.wplus.spb.ru NNTP-Posting-Date: 28 Jan 2003 14:30:34 GMT Mail-Copies-To: diwil@eis.ru User-Agent: KNode/0.7.1 Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news.mailgate.org!newsfeed.stueberl.de!newsfeed.vmunix.org!news1.spb.su!news.wplus.spb.ru!not-for-mail Xref: chonsp.franklin.ch comp.arch.fpga:25315 Yes Marc, it is possible. pull gcc from somewhere and check stormy16 port (h8300 more complex, yet understandable). this looks similar to yours and easy to understand. Also, you may want to ckeck msp430 port (mspgcc.sf.net) which is simple as well. However, if you want to _implement_ the toolchain, first of all you have to write binutils and gdb support with simulator... just in order to check if gcc works :) Cheers, Dmitry. Marc Van Riet wrote: > Hi, > > I'm writing a small processor core as a hobby. It is a small 16-bit core > with about 20 instructions, including simple ALU functions, memory read > and > writes, stack operations, ... All instructions can be conditional > (depending on the value of my 'working register'). Up to three operations > can be combined in a single opcode, although not all combinations are > possible. > > I was wondering if it would be do-able for me to port the GNU C-compiler > to > my own core. I guess it is possible, since the ARM has conditional > instructions too, and it has multiple instructions in one opcode too. > > But how long would that take me ? Anybody any experience in porting GNU-C > to a similar core as mine ? > > Are there any alternatives ? The LCC compiler isn't an option I think, > because their original target core doesn't have multiple-instructions or > conditional code. > > Any comments are appreciated, > Marc ###### From: "Wayne" Newsgroups: comp.arch.fpga Subject: Re: GNU C for custom processor Date: Wed, 29 Jan 2003 08:54:48 -0600 Organization: Lucent Technologies Lines: 38 Message-ID: References: <3e35c83e$0$27955$ba620e4c@news.skynet.be> NNTP-Posting-Host: il0015joanpark1.ih.lucent.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news.mailgate.org!newsfeed.stueberl.de!news2.euro.net!ash.uu.net!netnews.proxy.lucent.com!news Xref: chonsp.franklin.ch comp.arch.fpga:25373 I think Altera uses GNU-C for NIOS. "Marc Van Riet" wrote in message news:3e35c83e$0$27955$ba620e4c@news.skynet.be... > Hi, > > I'm writing a small processor core as a hobby. It is a small 16-bit core > with about 20 instructions, including simple ALU functions, memory read and > writes, stack operations, ... All instructions can be conditional > (depending on the value of my 'working register'). Up to three operations > can be combined in a single opcode, although not all combinations are > possible. > > I was wondering if it would be do-able for me to port the GNU C-compiler to > my own core. I guess it is possible, since the ARM has conditional > instructions too, and it has multiple instructions in one opcode too. > > But how long would that take me ? Anybody any experience in porting GNU-C to > a similar core as mine ? > > Are there any alternatives ? The LCC compiler isn't an option I think, > because their original target core doesn't have multiple-instructions or > conditional code. > > Any comments are appreciated, > Marc > > > > > > ###### NNTP-Posting-Date: Wed, 29 Jan 2003 09:08:01 -0600 From: Tim Olson Newsgroups: comp.arch.fpga Subject: Re: GNU C for custom processor Organization: none References: <3e35c83e$0$27955$ba620e4c@news.skynet.be> User-Agent: MT-NewsWatcher/3.1 (PPC) Date: Wed, 29 Jan 2003 09:08:14 -0600 Message-ID: Lines: 54 NNTP-Posting-Host: 199.170.89.3 X-Trace: sv3-jr1+0my7/2bO4QE8glsoN/bvfm5dCz6G1DJ8pNgadJUiVXwdRL0nRb4F9gp8o+b/YSunkv+Ikhu1SXh!PmpLaWJs7pb9E11wFRr2D0ewKJQR6OwF6+lKir/2GqXh/JOpniLr2NtyTuhGP9lktOH1EvMgw3GD!UcwOIkodWRlO6K5p6T85KuJ2sNE= X-Complaints-To: abuse@news.io.com X-DMCA-Complaints-To: abuse@news.io.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news.mailgate.org!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.frii.net!newsfeed.frii.net!140.99.99.194.MISMATCH!newsfeed1.easynews.com!easynews.com!easynews!newsfeed.news2me.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp3.aus1.giganews.com!nntp.news.io.com!news.news.io.com.POSTED!not-for-mail Xref: chonsp.franklin.ch comp.arch.fpga:25296 In article <3e35c83e$0$27955$ba620e4c@news.skynet.be>, "Marc Van Riet" wrote: | Hi, | | I'm writing a small processor core as a hobby. It is a small 16-bit core | with about 20 instructions, including simple ALU functions, memory read and | writes, stack operations, ... All instructions can be conditional | (depending on the value of my 'working register'). Up to three operations | can be combined in a single opcode, although not all combinations are | possible. | | I was wondering if it would be do-able for me to port the GNU C-compiler to | my own core. I guess it is possible, since the ARM has conditional | instructions too, and it has multiple instructions in one opcode too. A couple of years ago I ported GCC to an architecture similar to yours. At that time, there wasn't any explicit support in GCC for conditional operation or VLIW packing; I implemented conditional operation through "if-conversion" in the peephole optimizer, and the VLIW packing was done in a separate scheduling/packing phase in the assembler. Now that GCC has IA-64 support, it may be a better target for your architecture. | But how long would that take me ? Anybody any experience in porting GNU-C to | a similar core as mine ? A simple basic port (without working out all the subtle bugs) can be done in a man-month or so. It depends upon how far you want to take it. Basic code generation can be done fairly quickly, but getting really good code generation out requires more work (and is why many of the existing .md files are so non-intuitive). | | Are there any alternatives ? The LCC compiler isn't an option I think, | because their original target core doesn't have multiple-instructions or | conditional code. You might want to look at the Trimaran toolsuite: http://www.trimaran.org/ It was done to research instruction-level parallelism for IA-64 / HP Play-Doh architectures, which have similar features to your architecture. Intel just announced the Open Research Compiler project on SourceForge: http://ipf-orc.sourceforge.net -- -- Tim Olson ###### From: ldoolitt@recycle.lbl.gov (Larry Doolittle) Newsgroups: comp.arch.fpga Subject: Re: GNU C for custom processor Date: Thu, 30 Jan 2003 16:18:25 +0000 (UTC) Organization: LBNL News Server Lines: 19 Message-ID: References: <3e35c83e$0$27955$ba620e4c@news.skynet.be> <3e385045$0$5102$ba620e4c@news.skynet.be> NNTP-Posting-Host: recycle.lbl.gov X-Trace: overload.lbl.gov 1043943505 6838 131.243.169.124 (30 Jan 2003 16:18:25 GMT) X-Complaints-To: "newsmaster@lbl.gov" NNTP-Posting-Date: Thu, 30 Jan 2003 16:18:25 +0000 (UTC) X-Newsreader: slrn (0.9.4.3 UNIX) Path: chonsp.franklin.ch!pfaff.ethz.ch!news-zh.switch.ch!news.mailgate.org!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!elk.ncren.net!nntp.upenn.edu!info1.fnal.gov!news.lbl.gov!ldoolitt Xref: chonsp.franklin.ch comp.arch.fpga:25446 On Thu, 30 Jan 2003 23:06:10 +0100, Marc Van Riet wrote: >"Tim Olson" wrote in message >news:... >> >> A simple basic port [of gcc] (without working out all the subtle bugs) can be >> done in a man-month or so. It depends upon how far you want to take it. >> Also, you may want to ckeck msp430 port (mspgcc.sf.net) which is simple as >well. >> >I've worked with the H8300. It's a great processor family, but waaayyyy more >complicated than my core. The mps430 seems to be less complicated. I'm >checking the ports out now to see if I can make sense of it. I found "Porting GCC for Dunces" easy to read. But I haven't tried to put it into practice. It covers the port to the ETRAX processor, which may be about as simple as what you have in mind. Check it out. ftp://ftp.axis.se/pub/users/hp/pgccfd/ - Larry