• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. serial transmission of structures

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 64
  • Views 13269
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

serial transmission of structures

archive
archive over 19 years ago

hi there
I am looking for a 'proper' way to serially send data on a line (my application is ISO7816 but it could be any serial p[rotocol modeling)
Data are defined by

typedef enum byte {direct = 8'h3b, inverse = 8'h3f} t_InitChar;
typedef struct packed {
  bit td;
  bit tc;
  bit tb;
  bit ta;
  bit [3:0] nr_hist;
} t_FormatChar;

Which define the 7816 ATR patter

typedef struct packed {
  t_InitChar ts;
  t_FormatChar t0;
} t_atr;

I  can to send this patter by a s2p converter using the following

module p2s (in_array, out1, clk, reset, en);
parameter LE = 8;
   input clk, reset, en;
   input [LE-1:0] in_array;
   output      out1; 
   reg [LE:0]   par;
   reg         out1; 
   always @(posedge clk) begin
      if (reset)
          par
      else if (en)
          par
      else
          {out1,par}
   end // always @ (posedge clk)
endmodule // p2s

and compose a pre-filled array by the structure members: still, I feel this is not the proper 'SystemVerolog'  way

Srry for this newbie question by a Verilog user which is moving into System verilog :-)

thanks


Originally posted in cdnusers.org by marco.stanzani
  • Cancel
  • archive
    archive over 19 years ago

    Hello Marco,

    Since you defined your t_FormatChar type as a packed structure, you can treat it as a vector or access the individual fields. So your p2s module should be fine.  If you don't need to synthesize the p2s module you can use a task to do the parallel to serial transmission.  I have attached an example to this response in case you are interested.

    I hope that helps!

    Kathleen


    Originally posted in cdnusers.org by kameade
    • p2s.txt
    • View
    • Hide
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information