Skip to content

Instantly share code, notes, and snippets.

@jz5
Last active Dec 30, 2015
Embed
What would you like to do?
$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