Instantiation single signal in two agents

hai,

module top;
          mdio_if ino(mdc);
          phy_if in1(mdc);
          phy_if in2(mdc);
    dut_top DUT(.clk (clk),
                .rst (rst),
                .mdio (in0.mdio),
                .intr_0 (in1.intr),
                .intr_1 (in2.intr));
            endmodule
 in this mdio signal is inout. this mdio signal in mdio_if i have to use in in1 agent and in2 agent.and also what ever chages for mdio in in1 and in2 should reflect to in0. to get this functionality how to do. please give me any suggestion.

thanks in advance

In reply to nana:

There is no limitation to use a signal in more than 1 interface. But you have to take care to use in this case a wire.
BTW from your toplevel module I do not see any need for your phy_if. What are they doing? Is this only the interrupt handling?

thanks for your reply.
yes for intrrupt handling purpose only.
that mdio signals will read and write happening in mdio agent only but i want to use read and write mdio in phy related agents also. i will do some process in that agents that result i have to drive again to mdio. for that how to do.

In reply to nana:

It might be a challenge to synchronize the write to mdio from 3 different sources.
Could you please post some more code like the interface description for mdio_if and phy_if. What is mdc?

phy_mdc also one clock generated by the dut. actually my requirement is am having one set of phy_mdio and phy_mdc, with single set. I have to choose one phy from the 2 phys. This single mdio should share between two phys. to get this functionality am trying like this
this mdio and mdc am taking in one interface mdio_if and remining phy related signals am taking in another interface phy_if.

interface mdio_if (input bit phy_mdc,clk);
               wire phy_mdio;
               bit phy_rst_n;   
              endinterface            

interface phy_if (input bit phy_mdc,clk_p);
bit                          phy_intr;
bit                          phy_rst_n;              
wire			     phy_mdio;
eninterface   				    

module l4_crypt_top_tb();
              mdio_if          mdio(phy_mdc,clk);
              phy_if           phy_addr_4(phy_mdc,clk);
              phy_if           phy_addr_7(phy_mdc,clk);
              l4_crypt_test_top DUT(.clk_p (clk_p),
                       .phy_mdc        (phy_mdc),                              
                       .phy_mdio       (mdio.phy_mdio),                         
                       .phy_rst_n_0    ( phy_addr_4.phy_rst_n),                    
                       .phy_intr_0     ( phy_addr_4.phy_intr),                 
                       .phy_rst_n_1    ( phy_addr_7.phy_rst_n),                                                                                                                                                  .phy_intr_1     ( phy_addr_7.phy_intr)),  
                                       

In reply to nana:

I do not understand why you need 3 interfaces and corresponding agents. I believe the most simple solution is to have 1 interface and 1 agent only, because the phys are only reacting on the interrupts.

In reply to chr_sue:

interface mdio_if (input bit phy_mdc,clk);
               wire phy_mdio;
               bit phy_rst_n_0;  
               bit phy_rst_n_1; 
               bit  phy_intr_0; 
               bit  phy_intr_1; 
              endinterface     
module top_tb();
              mdio_if          mdio(phy_mdc,clk);     
              test_top DUT(.clk_p (clk_p),
                       .phy_mdc        (phy_mdc),                              
                       .phy_mdio       (mdio.phy_mdio),                         
                       .phy_rst_n_0    ( mdio.phy_rst_n_0), 
                       .phy_rst_n_1    ( mdio.phy_rst_n_1),                        
                       .phy_intr_0     ( mdio.phy_intr_0),                                                                                                                                                                                  .phy_intr_1     ( mdio.phy_intr_1)); 
 

like this u said right ?

In reply to nana:

Yes, this is as would do it. Then you have to define your interrupt sequences. If the interrupt happens. You have to stop the current sequence processing and run the interupt sequence. Afterwards you can continue.

In reply to chr_sue:
thank you for your rply chr_sue