/** A Connection between two Nodes, blocks */ global G_nodeCon { const WIDTH = 10; struct nodeConIn { write, read, enable, in[WIDTH] } } module nodeCon ( input clk, // clock input rst, // reset input a_in, output a_out[G_nodeCon.WIDTH], output done, //erledigt (blokirung kann uafgehoben werden) /*input b_write, input b_read, input b_enable, input b_in[WIDTH],*/ input b_in, output b_out[G_nodeCon.WIDTH], output error ) { dff internalBuff[G_nodeCon.WIDTH](#INIT(0), .clk(clk), .rst(rst)); always { error = ((a_in.write && b_in.write) || (a_in.read && b_in.read)) && ~rst && a_in.enable && b_in.enable; // gleichzeitiges lesen oder schreiben und nicht reset done = (a_in.write && b_in.write) || (a_in.read && b_in.write) && a_in.enable && b_in.enable; a_out = 0; if(a_in.enable) { if(a_in.write) { internalBuff.d = a_in; } else if(a_in.read) { a_out = internalBuff.q; } } b_out = 0; if(b_in.enable) { if(b_in.write) { internalBuff.d = b_in; } else if(b_in.read) { b_out = internalBuff.q; } } } }