From: Howard M. <ho...@fi...> - 2005-09-22 00:57:25
|
On Wed, 21 Sep 2005, Beau E. Cox wrote: > >Howard wrote: > > In the note to Rapheal, I suggest a modification to the sdcc source > >tree to allow for easy incorporation of new processors. I'd like to get > >that idea hammered out and a mechanism in place. > After reading your note to Raphael, I should explain further on how I integrate > my changes into the 'official' sdcc. The second of my scripts ( xml2chm ), produces > .h/.c/.m files for each processor as well as 'devices.inc', 'pics.all', and 'i2c.ignore'. > To integrate into sdcc ( before I do the sdcc build ), I copy the .h and .c files to > sdcc/device/include/pic16 and sdcc/device/lib/pic16/libdev. The .m files > (.m==miscellaneous) presently contain conversion warnings. Next I replace 'pics.all' and > 'i2c.ignore' in the sdcc tree. I then patch sdcc/src/pic16/device.c by removing the > standard device defs and replacing them with '#include "devices.inc"'. Two other minor > patches are applied because some of the names of the sfr bits changed in my > automated generation. I like your approach, and would like to suggest a slight modification. If you leave the standard defs in device.c, but include the '#include "devices.inc"' line, and then create an empty "devices.inc" file, the current cvs will compile as is. You can then create the devices.inc file automatically to add the support you need. I further suggest that the processor entrys for device.c be kept in seperate files that would be specified in the "devices.inc" file. Those files could be placed in a directory - maybe two (one for tested and verified, and one for untested experimental). As Microchip keeps adding pics, they can be integrated more easily on an ongoing basis. Eventually, the "standard" device.c defs might move to the external directory, or the other "def" files might move into the devices.c file. Also eventually, the configure script might have a switch like --with-experimental-pic16 or some such. A similar mechanism might be used for the i2c.ignore (I can only guess what that is at this point) and other device specific items. In any case, new processors will be added on an ongoing basis, and the files in question may come from a variety of origins. Eventually, we hope they come from a standardized definition file. In the interim, this approach or variation thereof would allow new processor support without contined modification to the cvs tree. Thanks, Howard |