Zach Welch wrote:
> Hi all,
>
> I feel like this is a "dumb question" but here goes.... Why aren't all
> of the TCL configuration files (src/target/{target,board,interface}/*)
> located in src/target/ instead of src/tcl/?
>
>
I presume you mean this: "why don't we just put all the files in one
monolithic directory full of files".
In the past, what we had was mostly monolithic config scripts... new
users (who where writing board configs) would toss up a configuration
file - that was monolithic. What they did not see was the 'parts' of the
configuration file. ie: The interface specification, the chip
specification, and things specific to the board (ie: which type of SDRAM
or external FLASH do you have).
The exact organization really does not matter to me, but the sub-folder
separation is really important.
Think of it as "visible architectural separation". By dividing the
configuration files into 3 different parts (interface, chip, board)- to
a new user of OpenOCD struggling to get a config file working its hard
to understand all the pieces to the puzzle.
Think of it as "human (mind) factors".
=
I too do not like the idea that there are "3 different roots one might
find tcl files in".... that is an entirely different matter, cleanup
perhaps would be good.
ie:
scripts/interface
scripts/chip
scripts/board
scripts/helpers
[etc...]
FYI - if you are in a "cleaning mood" here are some other ideas.
===
Example: "target->type->write_memory()" - could be refactored, 116
locations.
samething: read_memory() - 35 locations.
if( !target->type->examined ) -> 24 locations
I am a firm believer in "access functions" - (macros are ok) but access
functions are important.
Try this "grep" across the source code
egrep -nH -e '([a-z]+)->([a-z]+)->' *.c */*.c
===
Example:
The "scanfield_t" type - has no *common* initialization (zero) function
or macro, ie:
scanField_Init( &scan_field );
This means that if somebody "added a feature" to the scan field structure
There is no means to "default" new fields to a 'safe' value.
For example: a "char *debug_log_field_name"
The "init" function could set it to NULL - ie: 'un-named'
========
-Duane
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development