Skip to content

Instantly share code, notes, and snippets.

@jz5
Last active December 30, 2015 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jz5/7852875 to your computer and use it in GitHub Desktop.
Save jz5/7852875 to your computer and use it in GitHub Desktop.
$sscanf
initial begin
integer code;
reg [63:0] name;
reg [31:0] value;
code = $sscanf("reg1 = 0xc0ffee", "%s = 0x%h", name, value);
$display("code = %0d", code); // code = 2
$display("name = %0s", name); // name = reg1
$display("value = %h", value); // value = 00c0ffee
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment