+ /* timescale */
+ /* VCD can only handle 1/10/100 (s - fs), so scale up first */
+ if (ctx->samplerate > MHZ(1))
+ ctx->period = GHZ(1);
+ else if (ctx->samplerate > KHZ(1))
+ ctx->period = MHZ(1);
+ else
+ ctx->period = KHZ(1);
+ if (!(frequency_s = sigrok_period_string(ctx->period))) {
+ g_string_free(ctx->header, TRUE);
+ free(ctx);
+ return SR_ERR;
+ }
+ g_string_append_printf(ctx->header, "$timescale %s $end\n", frequency_s);
+ free(frequency_s);
+
+ /* scope */
+ g_string_append_printf(ctx->header, "$scope module %s $end\n", PACKAGE);
+