Polishing the component
piotr.wyderski_2406846 Aug 18, 2017 12:56 PMHello,
finally I am at the component's interface polishing stage (see the attached project). I want to setup the symbol parameters correctly and provide the user as much information as I can, so here are my questions:
1. The component has the 'clock' terminal, which currently can be manually configured as NCO_CLOCK_FREQUENCY. I want it to work automatically, so how do I infer the frequency of the clock routed to this pin? The Cypress ADC component somehow can do it in external clock mode -- the sample rate is derived from the connection.
2. From NCO_CLOCK_FREQUENCY and NCO_DEFAULT_FREQUENCY I can derive NCO_MIN_FREQUENCY and NCO_MAX_FREQUENCY. I would like to display their values to the user (in read-only mode), but if I move their definitions to the 'Formals' section, there is a problem. For some unknown reason Creator enforces parameter definitions in alphabetic order, so the MIN/MAX params are defined after NCO_DEFAULT_FREQUENCY, which derails its validators. How to work this issue around (without renaming the params, of course, as it is not very elegant)?
3. NCO_DEFAULT_DDS_INCREMENT is also calculated as an uint16. How do I extract its high/low bytesin Verilog to compute datapath registers' initialization values? Currently I provide two more auxiliary params, but I don't like this solution:
.d0_init_a(NCO_DEFAULT_DDS_INCREMENT_LO),
.d1_init_a(NCO_DEFAULT_DDS_INCREMENT_HI),
4. In MainsNCO.c I refer to the values of some hardware flags, e.g. the Count7 start flag or define the following FIFO flags:
#define FIFO0_CLR 0b00000001
#define FIFO1_CLR 0b00000010
#define FIFO0_LVL 0b00000100
#define FIFO1_LVL 0b00001000
I believe they are already defined somewhere, so there is no need to twiddle with their bit encodings, but I am unable to find them. What would be their names and, more importantly, how do you find them? (I think it is the 'where is ResourceMeter' kind of question, but anyway :) ).
-
testcases.cywrk_.Archive01.zip 474.4 K