GPIO Signaling with no-OS

Hi everyone,

I am working on ZC706 and FMCOMMS3 in a no-OS project. I need to create a GPIO pin signal(to be measured with an oscilloscope) for timing measurements. This signal needs to be created when a certain function in SDK(e.g ad9361_init()). I thought I could use XGpioPS I think these pins are already dedicated. Therefore, I looked for EMIO pins but all of them are connected. Since they are all connected, is there a way to create a GPIO signal from SDK?

Regards,

-Şükrü

Parents
  • Hi,

    I solved the problem and posting this for completenedss. Maybe it can be useful for somebody.

     One can use gpio_set_direction(PIN_NO, 1) (for output) and gpio_set_value(PIN_NO, VALUE) function in no-OS code for assignments. PIN_NO is determined in system_top.v. In order to add a custon gpio signal, we need to define the signal

     

    module system_top (
    
      //Other stuff
    
      // Custom GPIO
      inout                   gpio_custom_signal,
      
      inout                   gpio_muxout_tx,
      inout                   gpio_muxout_rx,
      inout                   gpio_resetb,
      inout                   gpio_sync,
      inout                   gpio_en_agc,
      inout       [ 3:0]      gpio_ctl,
      inout       [ 7:0]      gpio_status,
        
      //Other stuff    
    );
     

    Also we need to change the instantiations

    // Before custom gpio, DATA_WIDTH was 17
    ad_iobuf #(.DATA_WIDTH(18)) i_iobuf (
        .dio_t ({gpio_t[51:49], gpio_t[46:32]}),
        .dio_i ({gpio_o[51:49], gpio_o[46:32]}),
        .dio_o ({gpio_i[51:49], gpio_i[46:32]}),
        .dio_p ({ gpio_custom_signal, // 51:51 
                  gpio_muxout_tx,     // 50:50
                  gpio_muxout_rx,     // 49:49
                  gpio_resetb,        // 46:46
                  gpio_sync,          // 45:45
                  gpio_en_agc,        // 44:44
                  gpio_ctl,           // 43:40
                  gpio_status}));     // 39:32
    
      ad_iobuf #(.DATA_WIDTH(15)) i_iobuf_bd (
        .dio_t (gpio_t[14:0]),
        .dio_i (gpio_o[14:0]),
        .dio_o (gpio_i[14:0]),
        .dio_p (gpio_bd));
    
      //Before custom gpio the line was
      //assign gpio_i[63:51] = gpio_o[63:51];
      //Since I want to add a pin in gpio[51:51]
      //I need to unplug the default assignment
      assign gpio_i[63:52] = gpio_o[63:52];
      assign gpio_i[48:47] = gpio_o[48:47];
      assign gpio_i[31:15] = gpio_o[31:15];

    In no-OS code the PIN_NO in C function is determined by 54 + (Pin number in system_top.v) in this case 54 + 51 = 105

    Also in .xdc file we need to assign this to a physical pin.

    Regards

    -Şükrü

Reply
  • Hi,

    I solved the problem and posting this for completenedss. Maybe it can be useful for somebody.

     One can use gpio_set_direction(PIN_NO, 1) (for output) and gpio_set_value(PIN_NO, VALUE) function in no-OS code for assignments. PIN_NO is determined in system_top.v. In order to add a custon gpio signal, we need to define the signal

     

    module system_top (
    
      //Other stuff
    
      // Custom GPIO
      inout                   gpio_custom_signal,
      
      inout                   gpio_muxout_tx,
      inout                   gpio_muxout_rx,
      inout                   gpio_resetb,
      inout                   gpio_sync,
      inout                   gpio_en_agc,
      inout       [ 3:0]      gpio_ctl,
      inout       [ 7:0]      gpio_status,
        
      //Other stuff    
    );
     

    Also we need to change the instantiations

    // Before custom gpio, DATA_WIDTH was 17
    ad_iobuf #(.DATA_WIDTH(18)) i_iobuf (
        .dio_t ({gpio_t[51:49], gpio_t[46:32]}),
        .dio_i ({gpio_o[51:49], gpio_o[46:32]}),
        .dio_o ({gpio_i[51:49], gpio_i[46:32]}),
        .dio_p ({ gpio_custom_signal, // 51:51 
                  gpio_muxout_tx,     // 50:50
                  gpio_muxout_rx,     // 49:49
                  gpio_resetb,        // 46:46
                  gpio_sync,          // 45:45
                  gpio_en_agc,        // 44:44
                  gpio_ctl,           // 43:40
                  gpio_status}));     // 39:32
    
      ad_iobuf #(.DATA_WIDTH(15)) i_iobuf_bd (
        .dio_t (gpio_t[14:0]),
        .dio_i (gpio_o[14:0]),
        .dio_o (gpio_i[14:0]),
        .dio_p (gpio_bd));
    
      //Before custom gpio the line was
      //assign gpio_i[63:51] = gpio_o[63:51];
      //Since I want to add a pin in gpio[51:51]
      //I need to unplug the default assignment
      assign gpio_i[63:52] = gpio_o[63:52];
      assign gpio_i[48:47] = gpio_o[48:47];
      assign gpio_i[31:15] = gpio_o[31:15];

    In no-OS code the PIN_NO in C function is determined by 54 + (Pin number in system_top.v) in this case 54 + 51 = 105

    Also in .xdc file we need to assign this to a physical pin.

    Regards

    -Şükrü

Children
No Data