Robert Baruch wrote:

> Should I:
> 
> a) Write the 12-bit port from scratch?

This minimizes the encumbrance due to legacy code.

> b) Copy the 12-bit port from some non-PIC architecture and modify?

This substitutes some encumbrances for others.

> c) Copy the 12-bit port from the 14-bit port and modify?


This maximizes the encumbrance.

So, if you wish to minimize the encumbrance, start from scratch. But as 
an experienced developer I view encumbrance due to other's design 
decisions as just another way others think about a problem. Once I 
immerse myself into their way, I then decide if their decisions hold 
value or not.

When I started the PIC port, I copied the 8051 port and changed
everything that looked like an 8051 into a PIC. It was arduous. The
pic16 port began the same way but started with the pic (i.e. pic 14) 
port. This I presume was less arduous to get the initial stuff
working, but it still required a significant amount of work. Some of
that work was due to the design decisions I made on the pic14 port and
some due to the fundamental differences between the architectures.

If I were to initiate a 12-bit port, I'd begin with the closest
port. I'd start with the pic 14 port and change every that doesn't apply
to the 12-bit core. Since the architectures are so similar, I'd also
endeavor to overlap major portions of gen.c. I'd begin looking at gen.c 
to see exactly how much dependency there is on the 14-bit core. I 
suspect there's quite a bit. If there are too many differences, then it 
may make sense to copy the 14-bit directory into a 12-bit one and 
customizing it to the 12-bit core. If you take this route, begin with 
gen*.c. I'd save ralloc.c for last. The pCode stuff can be initially 
modified by just removing support for the arithmetic immediate 
instructions (like ADDLW).

In addition, you'll want to initially construct your own regression 
tests. I'd personally only target relocatable code and utilize gpsim's 
assertion mechanism. In this way, you can write self-checking code.

Once you have this initial pass completed (pic12 generation but pic14 
register allocation) you'll have had plenty of opportunities to 
understand ralloc.c and pcode*.c and will be ready to tackle them.

HTH

Scott

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to