Ok heres some of my code, I think I was mistakelnly thinking I can just press ram_de, and restart from zero, as long as ram_de was pressed, while not disturbing the rest of the bits that were
further than the bytes I decided to write in that time period. But this is non-sensical, if I want this to be efficient in luts, I cant have it both ways, the bits must be pushing themelves, thus affected by the last bit. If I wanna place bit in the 187th bit, I gotta think 187 moves ahead, and If I want to change it, they all have to get flushed either by writing or a reset.
I mean... The ram allocating mechanism is not some little robot on tracks that goes up 1 bitram when you say +1, and deposits the data like in the amazon factory, this is not how it works.
As such, the word "ram_de" will be changed to "spi_reg_reset". The counter is no longer there, is it seems like its use is redundant from my new POV, the data must be reset, not a counter, my new way of looking at the world
.
Here is the present code, as I am writing this, new questions arise in my brain, when I compare this particular example, I am still perplexed as to how I would adapt this "wire mentality"
into my particular case, I must admit I am not too comfortable with the rules of concatenation and if I am doing this right.
Please help me understand WTF I am doing.
Edit: I also notice in his code, he resets the data in the register with a <= block assignement. I dont in my code due to the rule of not having blocking assignements in clocked blocks.
http://referencedesigner.com/tutorials/verilog/verilog_32.phpmodule spi_rcv (important_byte,some_connection); // Should I seperate/concatenate now or later? Where should boundary be defined?
input wire spi_clk;
input wire spi_mosi;
input wire reset_spi_reg; //
//reg [7:0] spi_limit_switch; dont think this is really necessary, if I can reset all I can get known state.
wire [7:0]important_byte; // I seperate and send out all my bits via wires, not another reg, got it.
wire [n-8:0]some_connection; // this good?
reg [n-1:0]some_string; //
parameter n=184;
// godtoplevel spi_rcv_inst(.spi_clk(spi_clk),.spi_mosi(spi_mosi),.ram_de(ram_de)); ?? IS THIS REALLY NECESSARY??? SO ANNOYING
always @(posedge reset_spi_reg) begin
some_string=0;
assign{some_connection,important_byte}=some_string;
end
always @(negedge spi_clk) begin
// yeah I use negative, because my pin is a neg edge signal, do I GAIN EFFICIENCY in LUTS?
//doing negedge things with negedge pins?? because if its bad I'll just use posedge
if (reset_spi_reg == 0) begin //
some_string<={some_connection,important_byte};// Ok, we are using blocking assignement+ a concatenation.
//how to adapt this line to my situation?
//I read this is bad, so is this an exeption, due to chain nature??
assign {some_connection,important_byte}={spi_mosi, some_string[n-1:1]};// Hmm, again, how to adapt this line
// to my situation?
end
end