S
Strake
Guest
Hi,
I am using verilog to create a control unit for a microprocessor. The
basic premise of the processor is that data transfer is done on the
posedge and that calculation and execution is done on the negedge. The
instruction is is stored in a 32 bit register, of which bits 0-5 are
the opcode. Data transfer is done with 4 64-bit wires known as
path[0:3]; generally, path[2:3] are the operands and path[1] is the
result. (path[0] is reserved for future use.) My code looks something
like this:
// begin verilog code
always @(posedge ck) case(instruction[0:5])
14: begin // add immediate
path[2] <= D_FORM_RA; // load register operand A
path[3] <= D_FORM_SI; // load immediate operand B
alop <= ALU_ADD; // tell ALU that we want it to add
D_FORM_RT = path[1] @(posedge ck);
end
endcase
// end verilog code
Obviously, the actual code will handle more than just one opcode, but
this is a mere example.
My questions are these:
Firstly, will the line
D_FORM_RT = path[1] @(posedge ck);
have the intended effect of transferring the data on the _next_
posedge?
Secondly, will the always block reexecute on the next posedge,
alongside the delayed assignment?
I am using verilog to create a control unit for a microprocessor. The
basic premise of the processor is that data transfer is done on the
posedge and that calculation and execution is done on the negedge. The
instruction is is stored in a 32 bit register, of which bits 0-5 are
the opcode. Data transfer is done with 4 64-bit wires known as
path[0:3]; generally, path[2:3] are the operands and path[1] is the
result. (path[0] is reserved for future use.) My code looks something
like this:
// begin verilog code
always @(posedge ck) case(instruction[0:5])
14: begin // add immediate
path[2] <= D_FORM_RA; // load register operand A
path[3] <= D_FORM_SI; // load immediate operand B
alop <= ALU_ADD; // tell ALU that we want it to add
D_FORM_RT = path[1] @(posedge ck);
end
endcase
// end verilog code
Obviously, the actual code will handle more than just one opcode, but
this is a mere example.
My questions are these:
Firstly, will the line
D_FORM_RT = path[1] @(posedge ck);
have the intended effect of transferring the data on the _next_
posedge?
Secondly, will the always block reexecute on the next posedge,
alongside the delayed assignment?