[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: icarus, fork, and recursive tasks



> Actually, Icarus Verilog should support automatic tasks, even
> the 0.9 version that you say you're running. Maybe there is a
> bug that is tripped by a specific use?

$ iverilog -V
Icarus Verilog version 0.9.2  (v0_9_2)

Seems to be caused by --g1 :

$ iverilog -o sim -Wall -g1 tasks.v
tasks.v:10: syntax error
sh: line 1: 13425 Done                    /usr/lib/ivl/ivlpp -L -F"/tmp/ivrlg241f26ea8" -f"/tmp/ivrlg41f26ea8" -p"/tmp/ivrli41f26ea8"
     13426 Segmentation fault      (core dumped) | /usr/lib/ivl/ivl -C"/tmp/ivrlh41f26ea8" -C"/usr/lib/ivl/vvp.conf" -- -

`timescale 1ns / 1ps

module task_test ();

   reg [5:0] state;
   reg 	     cs_running;
   reg 	     wr_running;
   reg 	     wd_running;

   task automatic twait;
      input [7:0] count;
      begin
	 while (count > 0)
	   begin
	      #10 count = count - 1;
	   end
	 
      end
   endtask // twait

   task mcu_cs;
      input [7:0] count;
      begin
	 cs_running = 1;
	 twait (count);
	 cs_running = 0;
      end
   endtask // mcu_cs

   task mcu_wr;
      input [7:0] count;
      begin
	 wr_running = 1;
	 twait (count);
	 wr_running = 0;
      end
   endtask // mcu_cs
   
   task mcu_wd;
      input [7:0] count;
      begin
	 wd_running = 1;
	 twait (count);
	 wd_running = 0;
      end
   endtask // mcu_cs

   initial
     begin
	state = 0;
	cs_running = 0;
	wr_running = 0;
	wd_running = 0;
	#10;
	$dumpvars;
	#10 state = 1;
	#10;
	
	fork
	   mcu_cs (5);
	   mcu_wr (7);
	   mcu_wd (8);
	join

	#10 state = 3;
	#10 state = 4;
	#10 state = 5;
	$finish;
	#10;
	
     end

endmodule // task_test


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user