[Solved] Verilog

Discussion on Computer Software & Operating Systems
Locked
Pedz
Posts: 696
Joined: 2009-05-07 20:05

[Solved] Verilog

Post by Pedz »

Bit a of a longshot, but if anyone here knows verilog, need a bit of help :P

Basically, trying to initiate a module (left_rotation) inside a loop and starting on each positive clock. e.g

Code: Select all

genvar i;

 always @(posedge clk) begin

    if (req = 1) begin
       
        for(i=0; i<17;i= i+1) begin
            left_rotate("all the inputs/outputs")
            "makeoutputs next inputs, by assigning"
        end      

    end

Keep getting malfunction errors...
Any help would be great :) , purposely didnt copy the code here because I don't just want the answer, kinda want to know how it works so I may replicate it later and use it properly.

So basically would like to know how to instantiate modules within always/if/for loops.

Also don't know if this is 'off-topic' or software related :S, so posted it here, feel free to move if required.

Image
LITOralis.nMd
Retired PR Developer
Posts: 5658
Joined: 2010-04-10 16:15

Re: Verilog

Post by LITOralis.nMd »

EDIT: fail.
Last edited by LITOralis.nMd on 2012-01-10 10:29, edited 1 time in total.
Pedz
Posts: 696
Joined: 2009-05-07 20:05

Re: Verilog

Post by Pedz »

I found my problem finally! I have to just put the inputs <= outputs inside the always/if statement, and the module outside. (as well as some other stuff :P ). As this automatically calls the function...

Image
BloodyDeed
Retired PR Developer
Posts: 4452
Joined: 2008-05-07 17:43

Re: Verilog

Post by BloodyDeed »

Good to hear, going to lock the thread.
Thanks for posting how you fixed it.
Image
Locked

Return to “Software”