Skip to content

Instantly share code, notes, and snippets.

View gist:3109547
Imports GridApp.Data
Public Class MyGridView
Inherits GridView
Protected Overrides Sub PrepareContainerForItemOverride(element As DependencyObject, item As Object)
Dim viewModel = DirectCast(item, SampleDataCommon)
element.SetValue(VariableSizedWrapGrid.ColumnSpanProperty, viewModel.ColumnSpan)
View gist:7460489
initial begin
$system("date +%s.%N");
end
@jz5
jz5 / gist:7510777
Last active Dec 28, 2015
$save sample
View gist:7510777
initial begin
#100; $display("a");
#100; $display("b");
$save("checkpoint");
#100; $display("c");
#100; $display("d");
end
@jz5
jz5 / gist:7510792
Created Nov 17, 2013
$restart sample
View gist:7510792
initial begin
integer fd;
fd = $fopen("checkpoint", "rb");
if (fd !== 0) begin
$fclose(fd);
$restart("checkpoint");
end
end
@jz5
jz5 / gist:7510802
Created Nov 17, 2013
$save sim time
View gist:7510802
initial begin
$save("checkpoint");
$display("CHECKPOINT"); // $save 呼び出しと sim 時間が同じ
end
View gist:7510806
reg [7:0] r;
$display($bits(r)); // $bits(r): 8
$display($bits(1 << 8)); // $bits(1 << 8): 32
$display($bits(logic)); // $bits(logic): 1
@jz5
jz5 / gist:7510810
Created Nov 17, 2013
reg [$bits(r)-1:0] d;
View gist:7510810
reg [$bits(r)-1:0] d;
View gist:7510823
integer fd;
fd = $fopen("filename", "rb");
if (fd !== 0) begin
$fclose(fd);
// ファイルあり!
end
@jz5
jz5 / gist:7510845
Created Nov 17, 2013
$test$plusargs sample
View gist:7510845
if ($test$plusargs("FOO")) begin
$display("FOO");
end
@jz5
jz5 / gist:7510849
Last active Dec 28, 2015
$value$plusargs sample
View gist:7510849
integer foo;
if ($value$plusargs("FOO=%d", foo)) begin
$display("FOO = %0d", foo);
end