parasonic
Newbie level 3
- Joined
- Apr 19, 2010
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- USA
- Activity points
- 1,316
I have written a SPI master in Verilog to write values to a PLL synthesizer chip. It works. I am now trying to clean up my code so that I can put all of the parameters for the PLL at the top of the file either as parameters or macro-style definitions. In a few cases, I have some values that are larger and need to be split in half to fit into the SPI words which are inferred ROM. Here is an abbreviated form of my code.
This code doesn't seem to work, and I wouldn't really want to implement it with a wire. How should I approach this problem? Thanks!
Code:
...
// Define with whatever works, possibly a wire, parameter, or define
wire [12:0] pll_r_counter = 13'd49;
...
reg [0:1] spi_reg [7:0];
initial
begin
spi_reg[0] = pll_r_counter[7:0];
spi_reg[1] = {{3'b0},pll_r_counter[13:8]};
...
This code doesn't seem to work, and I wouldn't really want to implement it with a wire. How should I approach this problem? Thanks!