UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer rganesaa
Observer
2,859 Views
Registered: ‎09-18-2016

Can a matrix be passed as arguments in task?

Dear Sir,

I am using Vivado 2015.2.

 

I obviously got some doubts whether matrix can be passed on as arguments to a task.

 

Here is my source code:

`timescale 1ns / 1ps
module NoC_RG_demux_matrix_input(input wire [7:0] o1);

endmodule

 

Here is my test bench:

`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
module tb_NoC_RG_demux_matrix_input();
reg [7:0] o1;
reg [7:0] NoC_temp_data;
NoC_RG_demux_matrix_input N1(.o1(o1));
initial
begin
//source[0]=1;
//source[1]=1;
NoC_Commu_pop ({4,1},NoC_temp_data);
NoC_Commu_pop ({0,1},NoC_temp_data);
o1=NoC_temp_data;
$monitor("output o1= %d",o1);
end

task NoC_Commu_pop;
 input wire [7:0] source[0:1];
 output reg [7:0] NoC_temp_data;
 $monitor("source[0]= %d",source[0]);
 $monitor("source[1]= %d",source[1]);
//source[0]=1;
 //source[1]=1;
 if ({source[0],source[1]}=={4,1})
   NoC_temp_data=8;
  else
    NoC_temp_data=4;    
endtask;
endmodule

 

The program successfully runs and always outputs source[0]=0 source[1]=1 and NoC_temp_data=4.

 

Pl. advise if there is any error in code or whether Vivado 2015.2 support for matrix arguments for task has bugs.

 

Thanks.

 

Yours sincerely,

R. Ganesan.

NoC_RG_matrix_input_task.jpg
0 Kudos