//
// Generated by Bluespec Compiler, version 2006.11 (build 9629, 2006-11-11)
// 
// On Mon Feb 12 20:23:19 EST 2007
// 
// Method conflict info:
// Method: initiator_0_request_put
// Conflict-free: initiator_0_response_get,
// 	       initiator_1_request_put,
// 	       initiator_1_response_get,
// 	       target_0_request_get,
// 	       target_0_response_put,
// 	       target_1_request_get,
// 	       target_1_response_put
// Conflicts: initiator_0_request_put
//  
// Method: initiator_0_response_get
// Conflict-free: initiator_0_request_put,
// 	       initiator_1_request_put,
// 	       initiator_1_response_get,
// 	       target_0_request_get,
// 	       target_0_response_put,
// 	       target_1_request_get,
// 	       target_1_response_put
// Conflicts: initiator_0_response_get
//  
// Method: initiator_1_request_put
// Conflict-free: initiator_0_request_put,
// 	       initiator_0_response_get,
// 	       initiator_1_response_get,
// 	       target_0_request_get,
// 	       target_0_response_put,
// 	       target_1_request_get,
// 	       target_1_response_put
// Conflicts: initiator_1_request_put
//  
// Method: initiator_1_response_get
// Conflict-free: initiator_0_request_put,
// 	       initiator_0_response_get,
// 	       initiator_1_request_put,
// 	       target_0_request_get,
// 	       target_0_response_put,
// 	       target_1_request_get,
// 	       target_1_response_put
// Conflicts: initiator_1_response_get
//  
// Method: target_0_request_get
// Conflict-free: initiator_0_request_put,
// 	       initiator_0_response_get,
// 	       initiator_1_request_put,
// 	       initiator_1_response_get,
// 	       target_0_response_put,
// 	       target_1_request_get,
// 	       target_1_response_put
// Conflicts: target_0_request_get
//  
// Method: target_0_response_put
// Conflict-free: initiator_0_request_put,
// 	       initiator_0_response_get,
// 	       initiator_1_request_put,
// 	       initiator_1_response_get,
// 	       target_0_request_get,
// 	       target_1_request_get,
// 	       target_1_response_put
// Conflicts: target_0_response_put
//  
// Method: target_1_request_get
// Conflict-free: initiator_0_request_put,
// 	       initiator_0_response_get,
// 	       initiator_1_request_put,
// 	       initiator_1_response_get,
// 	       target_0_request_get,
// 	       target_0_response_put,
// 	       target_1_response_put
// Conflicts: target_1_request_get
//  
// Method: target_1_response_put
// Conflict-free: initiator_0_request_put,
// 	       initiator_0_response_get,
// 	       initiator_1_request_put,
// 	       initiator_1_response_get,
// 	       target_0_request_get,
// 	       target_0_response_put,
// 	       target_1_request_get
// Conflicts: target_1_response_put
//  
// 
// Ports:
// Name                         I/O  size props
// RDY_initiator_0_request_put    O     1
// initiator_0_response_get       O    44 reg
// RDY_initiator_0_response_get   O     1 reg
// RDY_initiator_1_request_put    O     1
// initiator_1_response_get       O    44 reg
// RDY_initiator_1_response_get   O     1 reg
// target_0_request_get           O    76 reg
// RDY_target_0_request_get       O     1 reg
// RDY_target_0_response_put      O     1
// target_1_request_get           O    76 reg
// RDY_target_1_request_get       O     1 reg
// RDY_target_1_response_put      O     1
// CLK                            I     1
// RST_N                          I     1
// initiator_0_request_put        I    76 reg
// initiator_1_request_put        I    76 reg
// target_0_response_put          I    44 reg
// target_1_response_put          I    44 reg
// EN_initiator_0_request_put     I     1
// EN_initiator_1_request_put     I     1
// EN_target_0_response_put       I     1
// EN_target_1_response_put       I     1
// EN_initiator_0_response_get    I     1
// EN_initiator_1_response_get    I     1
// EN_target_0_request_get        I     1
// EN_target_1_request_get        I     1
// 
// No combinational paths from inputs to outputs
// 
//

`ifdef BSV_ASSIGNMENT_DELAY
`else
`define BSV_ASSIGNMENT_DELAY
`endif

module mkSwitch(CLK,
		RST_N,
		
		initiator_0_request_put,
		EN_initiator_0_request_put,
		RDY_initiator_0_request_put,
		
		EN_initiator_0_response_get,
		initiator_0_response_get,
		RDY_initiator_0_response_get,
		
		initiator_1_request_put,
		EN_initiator_1_request_put,
		RDY_initiator_1_request_put,
		
		EN_initiator_1_response_get,
		initiator_1_response_get,
		RDY_initiator_1_response_get,
		
		EN_target_0_request_get,
		target_0_request_get,
		RDY_target_0_request_get,
		
		target_0_response_put,
		EN_target_0_response_put,
		RDY_target_0_response_put,
		
		EN_target_1_request_get,
		target_1_request_get,
		RDY_target_1_request_get,
		
		target_1_response_put,
		EN_target_1_response_put,
		RDY_target_1_response_put);
  input  CLK;
  input  RST_N;
  
  // action method initiator_0_request_put
  input  [75 : 0] initiator_0_request_put;
  input  EN_initiator_0_request_put;
  output RDY_initiator_0_request_put;
  
  // actionvalue method initiator_0_response_get
  input  EN_initiator_0_response_get;
  output [43 : 0] initiator_0_response_get;
  output RDY_initiator_0_response_get;
  
  // action method initiator_1_request_put
  input  [75 : 0] initiator_1_request_put;
  input  EN_initiator_1_request_put;
  output RDY_initiator_1_request_put;
  
  // actionvalue method initiator_1_response_get
  input  EN_initiator_1_response_get;
  output [43 : 0] initiator_1_response_get;
  output RDY_initiator_1_response_get;
  
  // actionvalue method target_0_request_get
  input  EN_target_0_request_get;
  output [75 : 0] target_0_request_get;
  output RDY_target_0_request_get;
  
  // action method target_0_response_put
  input  [43 : 0] target_0_response_put;
  input  EN_target_0_response_put;
  output RDY_target_0_response_put;
  
  // actionvalue method target_1_request_get
  input  EN_target_1_request_get;
  output [75 : 0] target_1_request_get;
  output RDY_target_1_request_get;
  
  // action method target_1_response_put
  input  [43 : 0] target_1_response_put;
  input  EN_target_1_response_put;
  output RDY_target_1_response_put;

  // signals for module outputs
  wire [75 : 0] target_0_request_get, target_1_request_get;
  wire [43 : 0] initiator_0_response_get, initiator_1_response_get;
  wire RDY_initiator_0_request_put,
       RDY_initiator_0_response_get,
       RDY_initiator_1_request_put,
       RDY_initiator_1_response_get,
       RDY_target_0_request_get,
       RDY_target_0_response_put,
       RDY_target_1_request_get,
       RDY_target_1_response_put;

  // submodule from_initiator_0
  wire [75 : 0] from_initiator_0$D_IN, from_initiator_0$D_OUT;
  wire from_initiator_0$CLR,
       from_initiator_0$DEQ,
       from_initiator_0$EMPTY_N,
       from_initiator_0$ENQ,
       from_initiator_0$FULL_N;
  FIFO2 #(.width(76), .guarded(1)) from_initiator_0(.RST_N(RST_N),
						    .CLK(CLK),
						    .D_IN(from_initiator_0$D_IN),
						    .ENQ(from_initiator_0$ENQ),
						    .DEQ(from_initiator_0$DEQ),
						    .CLR(from_initiator_0$CLR),
						    .D_OUT(from_initiator_0$D_OUT),
						    .FULL_N(from_initiator_0$FULL_N),
						    .EMPTY_N(from_initiator_0$EMPTY_N));

  // submodule from_initiator_1
  wire [75 : 0] from_initiator_1$D_IN, from_initiator_1$D_OUT;
  wire from_initiator_1$CLR,
       from_initiator_1$DEQ,
       from_initiator_1$EMPTY_N,
       from_initiator_1$ENQ,
       from_initiator_1$FULL_N;
  FIFO2 #(.width(76), .guarded(1)) from_initiator_1(.RST_N(RST_N),
						    .CLK(CLK),
						    .D_IN(from_initiator_1$D_IN),
						    .ENQ(from_initiator_1$ENQ),
						    .DEQ(from_initiator_1$DEQ),
						    .CLR(from_initiator_1$CLR),
						    .D_OUT(from_initiator_1$D_OUT),
						    .FULL_N(from_initiator_1$FULL_N),
						    .EMPTY_N(from_initiator_1$EMPTY_N));

  // submodule from_target_0
  wire [43 : 0] from_target_0$D_IN, from_target_0$D_OUT;
  wire from_target_0$CLR,
       from_target_0$DEQ,
       from_target_0$EMPTY_N,
       from_target_0$ENQ,
       from_target_0$FULL_N;
  FIFO2 #(.width(44), .guarded(1)) from_target_0(.RST_N(RST_N),
						 .CLK(CLK),
						 .D_IN(from_target_0$D_IN),
						 .ENQ(from_target_0$ENQ),
						 .DEQ(from_target_0$DEQ),
						 .CLR(from_target_0$CLR),
						 .D_OUT(from_target_0$D_OUT),
						 .FULL_N(from_target_0$FULL_N),
						 .EMPTY_N(from_target_0$EMPTY_N));

  // submodule from_target_1
  wire [43 : 0] from_target_1$D_IN, from_target_1$D_OUT;
  wire from_target_1$CLR,
       from_target_1$DEQ,
       from_target_1$EMPTY_N,
       from_target_1$ENQ,
       from_target_1$FULL_N;
  FIFO2 #(.width(44), .guarded(1)) from_target_1(.RST_N(RST_N),
						 .CLK(CLK),
						 .D_IN(from_target_1$D_IN),
						 .ENQ(from_target_1$ENQ),
						 .DEQ(from_target_1$DEQ),
						 .CLR(from_target_1$CLR),
						 .D_OUT(from_target_1$D_OUT),
						 .FULL_N(from_target_1$FULL_N),
						 .EMPTY_N(from_target_1$EMPTY_N));

  // submodule to_initiator_0
  wire [43 : 0] to_initiator_0$D_IN, to_initiator_0$D_OUT;
  wire to_initiator_0$CLR,
       to_initiator_0$DEQ,
       to_initiator_0$EMPTY_N,
       to_initiator_0$ENQ,
       to_initiator_0$FULL_N;
  FIFO2 #(.width(44), .guarded(1)) to_initiator_0(.RST_N(RST_N),
						  .CLK(CLK),
						  .D_IN(to_initiator_0$D_IN),
						  .ENQ(to_initiator_0$ENQ),
						  .DEQ(to_initiator_0$DEQ),
						  .CLR(to_initiator_0$CLR),
						  .D_OUT(to_initiator_0$D_OUT),
						  .FULL_N(to_initiator_0$FULL_N),
						  .EMPTY_N(to_initiator_0$EMPTY_N));

  // submodule to_initiator_1
  wire [43 : 0] to_initiator_1$D_IN, to_initiator_1$D_OUT;
  wire to_initiator_1$CLR,
       to_initiator_1$DEQ,
       to_initiator_1$EMPTY_N,
       to_initiator_1$ENQ,
       to_initiator_1$FULL_N;
  FIFO2 #(.width(44), .guarded(1)) to_initiator_1(.RST_N(RST_N),
						  .CLK(CLK),
						  .D_IN(to_initiator_1$D_IN),
						  .ENQ(to_initiator_1$ENQ),
						  .DEQ(to_initiator_1$DEQ),
						  .CLR(to_initiator_1$CLR),
						  .D_OUT(to_initiator_1$D_OUT),
						  .FULL_N(to_initiator_1$FULL_N),
						  .EMPTY_N(to_initiator_1$EMPTY_N));

  // submodule to_target_0
  wire [75 : 0] to_target_0$D_IN, to_target_0$D_OUT;
  wire to_target_0$CLR,
       to_target_0$DEQ,
       to_target_0$EMPTY_N,
       to_target_0$ENQ,
       to_target_0$FULL_N;
  FIFO2 #(.width(76), .guarded(1)) to_target_0(.RST_N(RST_N),
					       .CLK(CLK),
					       .D_IN(to_target_0$D_IN),
					       .ENQ(to_target_0$ENQ),
					       .DEQ(to_target_0$DEQ),
					       .CLR(to_target_0$CLR),
					       .D_OUT(to_target_0$D_OUT),
					       .FULL_N(to_target_0$FULL_N),
					       .EMPTY_N(to_target_0$EMPTY_N));

  // submodule to_target_1
  wire [75 : 0] to_target_1$D_IN, to_target_1$D_OUT;
  wire to_target_1$CLR,
       to_target_1$DEQ,
       to_target_1$EMPTY_N,
       to_target_1$ENQ,
       to_target_1$FULL_N;
  FIFO2 #(.width(76), .guarded(1)) to_target_1(.RST_N(RST_N),
					       .CLK(CLK),
					       .D_IN(to_target_1$D_IN),
					       .ENQ(to_target_1$ENQ),
					       .DEQ(to_target_1$DEQ),
					       .CLR(to_target_1$CLR),
					       .D_OUT(to_target_1$D_OUT),
					       .FULL_N(to_target_1$FULL_N),
					       .EMPTY_N(to_target_1$EMPTY_N));

  // rule scheduling signals
  wire CAN_FIRE_RL_initiator_0_to_target_0,
       CAN_FIRE_RL_initiator_0_to_target_1,
       CAN_FIRE_RL_initiator_1_to_target_0,
       CAN_FIRE_RL_initiator_1_to_target_1,
       CAN_FIRE_RL_target_0_to_initiator_0,
       CAN_FIRE_RL_target_0_to_initiator_1,
       CAN_FIRE_RL_target_1_to_initiator_0,
       CAN_FIRE_RL_target_1_to_initiator_1,
       CAN_FIRE_initiator_0_request_put,
       CAN_FIRE_initiator_0_response_get,
       CAN_FIRE_initiator_1_request_put,
       CAN_FIRE_initiator_1_response_get,
       CAN_FIRE_target_0_request_get,
       CAN_FIRE_target_0_response_put,
       CAN_FIRE_target_1_request_get,
       CAN_FIRE_target_1_response_put,
       WILL_FIRE_RL_initiator_0_to_target_0,
       WILL_FIRE_RL_initiator_0_to_target_1,
       WILL_FIRE_RL_initiator_1_to_target_0,
       WILL_FIRE_RL_initiator_1_to_target_1,
       WILL_FIRE_RL_target_0_to_initiator_0,
       WILL_FIRE_RL_target_0_to_initiator_1,
       WILL_FIRE_RL_target_1_to_initiator_0,
       WILL_FIRE_RL_target_1_to_initiator_1,
       WILL_FIRE_initiator_0_request_put,
       WILL_FIRE_initiator_0_response_get,
       WILL_FIRE_initiator_1_request_put,
       WILL_FIRE_initiator_1_response_get,
       WILL_FIRE_target_0_request_get,
       WILL_FIRE_target_0_response_put,
       WILL_FIRE_target_1_request_get,
       WILL_FIRE_target_1_response_put;

  // action method initiator_0_request_put
  assign RDY_initiator_0_request_put = from_initiator_0$FULL_N ;
  assign WILL_FIRE_initiator_0_request_put = EN_initiator_0_request_put ;
  assign CAN_FIRE_initiator_0_request_put = EN_initiator_0_request_put ;

  // actionvalue method initiator_0_response_get
  assign initiator_0_response_get = to_initiator_0$D_OUT ;
  assign RDY_initiator_0_response_get = to_initiator_0$EMPTY_N ;
  assign WILL_FIRE_initiator_0_response_get = EN_initiator_0_response_get ;
  assign CAN_FIRE_initiator_0_response_get = EN_initiator_0_response_get ;

  // action method initiator_1_request_put
  assign RDY_initiator_1_request_put = from_initiator_1$FULL_N ;
  assign WILL_FIRE_initiator_1_request_put = EN_initiator_1_request_put ;
  assign CAN_FIRE_initiator_1_request_put = EN_initiator_1_request_put ;

  // actionvalue method initiator_1_response_get
  assign initiator_1_response_get = to_initiator_1$D_OUT ;
  assign RDY_initiator_1_response_get = to_initiator_1$EMPTY_N ;
  assign WILL_FIRE_initiator_1_response_get = EN_initiator_1_response_get ;
  assign CAN_FIRE_initiator_1_response_get = EN_initiator_1_response_get ;

  // actionvalue method target_0_request_get
  assign RDY_target_0_request_get = to_target_0$EMPTY_N ;
  assign target_0_request_get = to_target_0$D_OUT ;
  assign WILL_FIRE_target_0_request_get = EN_target_0_request_get ;
  assign CAN_FIRE_target_0_request_get = EN_target_0_request_get ;

  // action method target_0_response_put
  assign RDY_target_0_response_put = from_target_0$FULL_N ;
  assign WILL_FIRE_target_0_response_put = EN_target_0_response_put ;
  assign CAN_FIRE_target_0_response_put = EN_target_0_response_put ;

  // actionvalue method target_1_request_get
  assign target_1_request_get = to_target_1$D_OUT ;
  assign RDY_target_1_request_get = to_target_1$EMPTY_N ;
  assign WILL_FIRE_target_1_request_get = EN_target_1_request_get ;
  assign CAN_FIRE_target_1_request_get = EN_target_1_request_get ;

  // action method target_1_response_put
  assign RDY_target_1_response_put = from_target_1$FULL_N ;
  assign WILL_FIRE_target_1_response_put = EN_target_1_response_put ;
  assign CAN_FIRE_target_1_response_put = EN_target_1_response_put ;

  // rule RL_target_1_to_initiator_1
  assign WILL_FIRE_RL_target_1_to_initiator_1 =
	     from_target_1$EMPTY_N && to_initiator_1$FULL_N &&
	     from_target_1$D_OUT[32] ;
  assign CAN_FIRE_RL_target_1_to_initiator_1 =
	     WILL_FIRE_RL_target_1_to_initiator_1 ;

  // rule RL_target_0_to_initiator_1
  assign CAN_FIRE_RL_target_0_to_initiator_1 =
	     to_initiator_1$FULL_N && from_target_0$EMPTY_N &&
	     from_target_0$D_OUT[32] ;
  assign WILL_FIRE_RL_target_0_to_initiator_1 =
	     CAN_FIRE_RL_target_0_to_initiator_1 &&
	     !WILL_FIRE_RL_target_1_to_initiator_1 ;

  // rule RL_target_1_to_initiator_0
  assign WILL_FIRE_RL_target_1_to_initiator_0 =
	     from_target_1$EMPTY_N && to_initiator_0$FULL_N &&
	     !from_target_1$D_OUT[32] ;
  assign CAN_FIRE_RL_target_1_to_initiator_0 =
	     WILL_FIRE_RL_target_1_to_initiator_0 ;

  // rule RL_target_0_to_initiator_0
  assign CAN_FIRE_RL_target_0_to_initiator_0 =
	     from_target_0$EMPTY_N && to_initiator_0$FULL_N &&
	     !from_target_0$D_OUT[32] ;
  assign WILL_FIRE_RL_target_0_to_initiator_0 =
	     CAN_FIRE_RL_target_0_to_initiator_0 &&
	     !WILL_FIRE_RL_target_1_to_initiator_0 ;

  // rule RL_initiator_1_to_target_1
  assign WILL_FIRE_RL_initiator_1_to_target_1 =
	     from_initiator_1$EMPTY_N && to_target_1$FULL_N &&
	     from_initiator_1$D_OUT[32] ;
  assign CAN_FIRE_RL_initiator_1_to_target_1 =
	     WILL_FIRE_RL_initiator_1_to_target_1 ;

  // rule RL_initiator_0_to_target_1
  assign CAN_FIRE_RL_initiator_0_to_target_1 =
	     to_target_1$FULL_N && from_initiator_0$EMPTY_N &&
	     from_initiator_0$D_OUT[32] ;
  assign WILL_FIRE_RL_initiator_0_to_target_1 =
	     CAN_FIRE_RL_initiator_0_to_target_1 &&
	     !WILL_FIRE_RL_initiator_1_to_target_1 ;

  // rule RL_initiator_1_to_target_0
  assign WILL_FIRE_RL_initiator_1_to_target_0 =
	     from_initiator_1$EMPTY_N && to_target_0$FULL_N &&
	     !from_initiator_1$D_OUT[32] ;
  assign CAN_FIRE_RL_initiator_1_to_target_0 =
	     WILL_FIRE_RL_initiator_1_to_target_0 ;

  // rule RL_initiator_0_to_target_0
  assign CAN_FIRE_RL_initiator_0_to_target_0 =
	     from_initiator_0$EMPTY_N && to_target_0$FULL_N &&
	     !from_initiator_0$D_OUT[32] ;
  assign WILL_FIRE_RL_initiator_0_to_target_0 =
	     CAN_FIRE_RL_initiator_0_to_target_0 &&
	     !WILL_FIRE_RL_initiator_1_to_target_0 ;

  // submodule from_initiator_0
  assign from_initiator_0$D_IN = initiator_0_request_put ;
  assign from_initiator_0$DEQ =
	     WILL_FIRE_RL_initiator_0_to_target_1 ||
	     WILL_FIRE_RL_initiator_0_to_target_0 ;
  assign from_initiator_0$ENQ = EN_initiator_0_request_put ;
  assign from_initiator_0$CLR = 1'b0 ;

  // submodule from_initiator_1
  assign from_initiator_1$D_IN = initiator_1_request_put ;
  assign from_initiator_1$DEQ =
	     WILL_FIRE_RL_initiator_1_to_target_1 ||
	     WILL_FIRE_RL_initiator_1_to_target_0 ;
  assign from_initiator_1$ENQ = EN_initiator_1_request_put ;
  assign from_initiator_1$CLR = 1'b0 ;

  // submodule from_target_0
  assign from_target_0$D_IN = target_0_response_put ;
  assign from_target_0$DEQ =
	     WILL_FIRE_RL_target_0_to_initiator_1 ||
	     WILL_FIRE_RL_target_0_to_initiator_0 ;
  assign from_target_0$ENQ = EN_target_0_response_put ;
  assign from_target_0$CLR = 1'b0 ;

  // submodule from_target_1
  assign from_target_1$D_IN = target_1_response_put ;
  assign from_target_1$DEQ =
	     WILL_FIRE_RL_target_1_to_initiator_1 ||
	     WILL_FIRE_RL_target_1_to_initiator_0 ;
  assign from_target_1$ENQ = EN_target_1_response_put ;
  assign from_target_1$CLR = 1'b0 ;

  // submodule to_initiator_0
  assign to_initiator_0$D_IN =
	     WILL_FIRE_RL_target_1_to_initiator_0 ?
	       from_target_1$D_OUT :
	       from_target_0$D_OUT ;
  assign to_initiator_0$DEQ = EN_initiator_0_response_get ;
  assign to_initiator_0$ENQ =
	     WILL_FIRE_RL_target_1_to_initiator_0 ||
	     WILL_FIRE_RL_target_0_to_initiator_0 ;
  assign to_initiator_0$CLR = 1'b0 ;

  // submodule to_initiator_1
  assign to_initiator_1$D_IN =
	     WILL_FIRE_RL_target_1_to_initiator_1 ?
	       from_target_1$D_OUT :
	       from_target_0$D_OUT ;
  assign to_initiator_1$DEQ = EN_initiator_1_response_get ;
  assign to_initiator_1$ENQ =
	     WILL_FIRE_RL_target_1_to_initiator_1 ||
	     WILL_FIRE_RL_target_0_to_initiator_1 ;
  assign to_initiator_1$CLR = 1'b0 ;

  // submodule to_target_0
  assign to_target_0$D_IN =
	     WILL_FIRE_RL_initiator_0_to_target_0 ?
	       from_initiator_0$D_OUT :
	       from_initiator_1$D_OUT ;
  assign to_target_0$DEQ = EN_target_0_request_get ;
  assign to_target_0$ENQ =
	     WILL_FIRE_RL_initiator_0_to_target_0 ||
	     WILL_FIRE_RL_initiator_1_to_target_0 ;
  assign to_target_0$CLR = 1'b0 ;

  // submodule to_target_1
  assign to_target_1$D_IN =
	     WILL_FIRE_RL_initiator_0_to_target_1 ?
	       from_initiator_0$D_OUT :
	       from_initiator_1$D_OUT ;
  assign to_target_1$ENQ =
	     WILL_FIRE_RL_initiator_0_to_target_1 ||
	     WILL_FIRE_RL_initiator_1_to_target_1 ;
  assign to_target_1$DEQ = EN_target_1_request_get ;
  assign to_target_1$CLR = 1'b0 ;
endmodule  // mkSwitch

