reuse_block features

Caters for empty varargin.
'help reuse_block' now gives useful info and not copyright notice.
Cater with implicit library link status better.
mdl2m features addition

* handles generation logic for adding lines.

* allows the use of reuse_block instead of add_block.

* better sorting method for blocks and lines. Blocks are sorted into Inports,
  then other blocks based on distance from top left corner, then Outports.
  Lines are sorted by source block in the same way.

* Many other small formatting changes.
Update uniform-to-normal block w/ DDS 4.0 compiler

The uniform-to-normal (u2n) block used a SineCosine block to generate the sine
and cosine values used for the Box-Muller transform.  The SineCosine block has
been discontinued and replaced by the "DDS 4.0 Compiler" block.

This commit changes the u2n block in casper_library_sources.mdl to use the "DDS
4.0 Compiler" block instead of the SineCosine block.  While still performing
the same transform, the outputs of the new u2n block will not be identical to
the output of the old u2n block since 1) the DDS 4.0 Compiler block's output is
not the same as the SineCosine block and 2) the latency of the DDS 4.0 Compiler
block is longer than the SineCosine block.

Systems that correlate the outputs of an old u2n block with a new u2n block
will notice these differences as slightly reduced correlation and a non-zero
relative delay.

The wgn_test.mdl test file and the reference output file also updated.
Add register comments to ADC16 VHDL code

These new comments describe the new ZDOK pinout revision information bits that
are available in register 0 of the adc16_controller device.
Remove unused parameters from Gateway Ins/Outs

Older System Generator versions did not provide the following parameters for
Gateway In (ADC related) or Gateway Out (DAC related) blocks:

UseAsADC
ADCChannel
UseAsDAC
DACChannel
inherit_from_input

These settings have been surgically removed (with a text editor) from library
model files that contained them so this change is theoretically mergeable.
Set more Downsample block parameters in adc_mask

The Downsample block in newer versions of the DSP blockset require additional
parameter settings that the older version did have.  This change sets these
parameters in newer versions, but still works for older versions.
Disable some annoying Simulink warnings

This changes startup.m to disable some annoying Simulink warnings that are
commonly encountered in normal CASPER development.  These numerous yet
innoucous warnings make it harder to detect more serious warnings or errors.
Some of these warnings were previously disabled, but the message identifier for
these warnings appears to have changed in newer Simulink versions.  The old
message identifiers were left in for backwards compatibility.
Stifle CallbackDelete exceptions in mask scripts

For reasons that are not clear, the GPIO and Software Register mask
initializers are sometimes called from within a callback.  When they try to
remove their blocks (in preparation of redrawing them), a
Simulink:Engine:CallbackDelete exception is thrown.  Allowing this exception to
propagate up the callback's call stack leaves Matlab/Simulink in bad state.
Since these scripts should not be redrawing themsleves at that time, they now
catch this exception and simply return.

These mask initializers should probably be rewritten at some point to use
functions (instead of plain scripts) and to use same_state/save_state.
Re-enable same_state call in pipeline_init.m
Make reuse_block more pedantic

For some unknown reason, find_system will sometimes return more than one block
for a given name.  Sometimes it's simply just more than one reference to the
same block, which is weird but OK.  Othertimes it really thinks there are two
different blocks with the same name, which is indicative of some bizarre error
condition that needs attention.  This change makes reuse_block a bit more
pedantic about how it handles multiple blocks being returned by find_system.
If the multiple blocks are simply duplication of the same block, it will
proceed normally, but if the multiple blocks are distinct, it will throw an
exception.
Save casper_library.mdl in Simulink 7.2 format
Clean mask entries in casper_library_accumulators

When loading casper_library_accumulators, warnings about ignoring excess mask
dialog entries were reported for the following two (unmasked!) blocks:

casper_library_accumulators/dram_vacc/RB_reg
casper_library_accumulators/dram_vacc/fifo_empty_check

This removes these extraneous mask dialog entries and saves
casper_library_accumulators.mdl inSimulink 7.2 format.
Add update_casper_blocks function

When migrating from one CASPER library version to another, existing models that
contain links to blocks in the older version may need to be "redrawn", i.e.
deleted, re-added from the updated library, and configured like the original
block.  This is a tedious task to do manually for even one largish block (e.g.
FFT) so it is often not done at all (or only as a last resort).  Unfortunately,
not updating the CASPER blocks of an existing model can lead to subtle (or not
so subtle!) problems because the original blocks' masks can be incompatible
with the new initialization scripts in the library.

A new function named 'update_casper_blocks' (MB: plural) addresses this
problem.  This function will search through a model (aka "block diagram") or an
unlinked subsystem for CASPER blocks.  The other new function
"update_casper_block" (NB: singular) is called for every CASPER block found.
This function will add a corresponding new block from the CASPER library,
configure its mask parameters to match the old block's mask parameters, delete
the old block, then move the new block into the old block's position and
orientation as well as rename it to the old block's name.

A warning is issued for any blocks whose new version has parameters that the
old version lacks.  This is not a problem if these parameters have backwards
compatible default values, but be sure to verify.

To help prevent the new block's init script from being called for each
parameter change, the "same_state" function has been modified to recognize a
"force_same_state" flag so that init scripts utilizing same_state will be held
off until update_casper_block finishes updating the new block's parameters.

If update_casper_blocks is given a (non-library) block diagram, the block
diagram's Solver is set to the Xilinx recommended/supported settings by passing
the block diagram to the xlConfigureSolver function.

To update a model named "my_design.mdl", do the following four steps:

1) Open the model

2) Save the model (maybe optional?)

3) In the MATLAB Command Window, enter:

   update_casper_blocks('my_design')

4) Save the model

The update_casper_blocks function outputs details about its actions including
which blocks are being replaced and which masked-but-unlinked-subsystems are
being searched.  After running update_casper_blocks the "update diagram"
command should succeed.

Note that due to possible behavioral changes in the CASPER library blocks, the
model may not function exactly the same (e.g. due to changes in rounding modes)
or even correctly (e.g. due to unexpected changes in latency).  Please be sure
to verify the functionality of the updated model (either via simulation or
using actual hardware).
scripts for static blocks in Downconverter library
Downconverter default case in init scripts

Adds tests to scripts to generate empty block for certain
parameter combinations. Allows storage of empty block in
library.
downconverter library generation, cosin block

The downconverter section of the library is now generated (using
casper_library_downconvert_init.m) as the bus section is. Any saved
changes will trigger the re-generation of this script (via mdl2m.m).
This should help make merge conflicts less likely and easier to solve.

The cosin block has been added to the Downconverter library. This allows
complex exponentials to be generated with various optimisations. Will be
used in future DDC and FFT improvements.

casper_library.mdl is in Simulink version 8 format, will attempt a back-port
to 7.9 in a future commit.
Compatible with Simulink 7.2 (R2008b)
fft_stage_n fully scripted

now fully generated by script. Stored in empty form in library to help
ensure no stale blocks and reduce amount of modification required to .mdl
files.

Saved in Simulink 7.2 (R2008b) format.
casper_library_downconverter.* force ignore

casper_library_downconverter.(slx/mdl) generated from script so
force git to ignore.
Make update_casper_block replace deprecated blocks

If the block being updated is linked to a deprecated edge detection block (i.e.
"edge", "negedge", or "posedge"), update_casper_block will now automatically
replace that block with a link to an "edge detect" block.