clash-lib-0.99: prims/systemverilog/Clash_Signal_Internal.json
[ { "BlackBox" :
{ "name" : "Clash.Signal.Internal.delay#"
, "type" :
"delay#
:: HasCallStack -- ARG[0]
=> Clock domain gated -- ARG[1]
-> Signal clk a -- ARG[2]
-> Signal clk a"
, "templateD" :
"// register begin~IF ~ISGATED[1] ~THEN
always_ff @(posedge ~ARG[1][1]) begin : ~GENSYM[~COMPNAME_delay][0]
if (~ARG[1][0]) begin
~RESULT <= ~ARG[2];
end
end~ELSE
always_ff @(posedge ~ARG[1]) begin : ~SYM[0]
~RESULT <= ~ARG[2];
end~FI
// register end"
}
}
, { "BlackBox" :
{ "name" : "Clash.Signal.Internal.register#"
, "type" :
"register#
:: HasCallStack -- ARG[0]
=> Clock domain gated -- ARG[1]
-> Reset domain synchronous -- ARG[2]
-> a -- ARG[3]
-> Signal clk a -- ARG[4]
-> Signal clk a"
, "templateD" :
"// register begin~IF ~ISGATED[1] ~THEN
always_ff @(posedge ~ARG[1][1]~IF ~ISSYNC[2] ~THEN ~ELSE or posedge ~ARG[2]~FI) begin : ~GENSYM[~COMPNAME_register][0]
if (~ARG[2]) begin
~RESULT <= ~ARG[3];
end else if (~ARG[1][0]) begin
~RESULT <= ~ARG[4];
end
end~ELSE
always_ff @(posedge ~ARG[1]~IF ~ISSYNC[2] ~THEN ~ELSE or posedge ~ARG[2]~FI) begin : ~SYM[0]
if (~ARG[2]) begin
~RESULT <= ~ARG[3];
end else begin
~RESULT <= ~ARG[4];
end
end~FI
// register end"
}
}
, { "BlackBox" :
{ "name" : "Clash.Signal.Internal.clockGate"
, "type" :
"clockGate
:: Clock domain gated -- ARG[0]
-> Signal domain Bool -- ARG[1]
-> Clcok domain 'Gated"
, "templateD" :
"// clockGate begin~IF ~ISGATED[0] ~THEN
assign ~RESULT = {~ARG[0][1],~ARG[0][0] & ~ARG[1]};~ELSE
assign ~RESULT = {~ARG[0],~ARG[1]};~FI
// clockGate end"
}
}
, { "BlackBox" :
{ "name" : "Clash.Signal.Internal.clockGen"
, "type" :
"clockGen
:: (domain ~ Dom nm period -- ARG[0]
,KnownSymbol nm -- ARG[1]
,KnownNat period) -- ARG[2]
=> Clock domain Source"
, "templateD" :
"// pragma translate_off
// 1 = 0.1ps
localparam ~GENSYM[half_period][0] = (~LIT[2]0 / 2);
always begin
~RESULT = 0;
#3000 forever begin
~RESULT = ~ ~RESULT;
#~SYM[0];
~RESULT = ~ ~RESULT;
#~SYM[0];
end
end
// pragma translate_on"
}
}
, { "BlackBox" :
{ "name" : "Clash.Signal.Internal.tbClockGen"
, "type" :
"tbClockGen
:: (domain ~ Dom nm period -- ARG[0]
,KnownSymbol nm -- ARG[1]
,KnownNat period) -- ARG[2]
=> Signal domain Bool -- ARG[3]
-> Clock domain Source"
, "templateD" :
"// pragma translate_off
// 1 = 0.1ps
localparam ~GENSYM[half_period][0] = (~LIT[2]0 / 2);
always begin
~RESULT = 0;
#3000 forever begin
if (~ ~ARG[3]) begin
$finish;
end
~RESULT = ~ ~RESULT;
#~SYM[0];
~RESULT = ~ ~RESULT;
#~SYM[0];
end
end
// pragma translate_on"
}
}
, { "BlackBox" :
{ "name" : "Clash.Signal.Internal.asyncResetGen"
, "type" : "asyncResetGen :: Reset domain Asynchronous"
, "templateD" :
"// pragma translate_off
initial begin
#1 ~RESULT = 1;
#1999 ~RESULT = 0;
end
// pragma translate_on"
}
}
, { "BlackBox" :
{ "name" : "Clash.Signal.Internal.syncResetGen"
, "type" : "asyncResetGen :: Reset domain Synchronous"
, "templateD" :
"// pragma translate_off
localparam ~GENSYM[reset_period][1] = 2998 + ~LIT[1]0;
initial begin
#1 ~RESULT = 1;
#~SYM[1] ~RESULT = 0;
end
// pragma translate_on"
}
}
, { "BlackBox" :
{ "name" : "Clash.Signal.Internal.unsafeFromAsyncReset"
, "type" :
"unsafeFromAsyncReset :: Reset domain Asynchronous -> Signal domain Bool"
, "templateE" : "~ARG[0]"
}
}
, { "BlackBox" :
{ "name" : "Clash.Signal.Internal.unsafeToAsyncReset"
, "type" :
"unsafeToAsyncReset :: Signal domain Bool -> Reset domain Asynchronous"
, "templateE" : "~ARG[0]"
}
}
, { "BlackBox" :
{ "name" : "Clash.Signal.Internal.fromSyncReset"
, "type" :
"fromSyncReset :: Reset domain Synchronous -> Signal domain Bool"
, "templateE" : "~ARG[0]"
}
}
, { "BlackBox" :
{ "name" : "Clash.Signal.Internal.unsafeToSyncReset"
, "type" :
"unsafeToSyncReset :: Signal domain Bool -> Reset domain Synchronous"
, "templateE" : "~ARG[0]"
}
}
, { "Primitive" :
{ "name" : "Clash.Signal.Internal.signal#"
, "primType" : "Function"
}
}
, { "Primitive" :
{ "name" : "Clash.Signal.Internal.mapSignal#"
, "primType" : "Function"
}
}
, { "Primitive" :
{ "name" : "Clash.Signal.Internal.appSignal#"
, "primType" : "Function"
}
}
, { "Primitive" :
{ "name" : "Clash.Signal.Internal.foldr#"
, "primType" : "Function"
}
}
, { "Primitive" :
{ "name" : "Clash.Signal.Internal.traverse#"
, "primType" : "Function"
}
}
, { "Primitive" :
{ "name" : "Clash.Signal.Internal.joinSignal#"
, "primType" : "Function"
}
}
]