SystemLisp - an HDL simulator written in Common Lisp
#lisp #commonlisp #hdl #rtl #verilog #design #verification #vhdl #systemverilog #vlsi #programming #fpga
SystemLisp - an HDL simulator written in Common Lisp
#lisp #commonlisp #hdl #rtl #verilog #design #verification #vhdl #systemverilog #vlsi #programming #fpga
Выступил отрицателем AI на конференции SNUG Silicon Valley
AI - не микроархитектор, не проектировщик и не верификатор. Это все-лишь гламурный поисковик уже решенных и опубликованных задач. Именно такой вывод следовал из предоставленных мною на конференции SNUG Silicon Valley 2026 фактов как десятки студентов мучали ИИ чтобы решить мои задачки. Одну задачку ИИ решил лишь через полгода после выкладывания решений в интернет, другую за два месяца, потом пошла третья. При этом задачки были довольно банальные - мы в Самсунге даем делать такие статические конвейеры с контролем потока данных практикантам. Вот постер, сопровождающий мою статью:
https://habr.com/ru/articles/1010978/?utm_source=habrahabr&utm_medium=rss&utm_campaign=1010978
#SNUG #Synopsys #Silicon_Valley #школа_синтеза_цифровых_схем #SystemVerilog #ASIC #FPGA #Samsung #задачи_на_собеседованиях #VHDL
Выступил отрицателем AI на конференции SNUG Silicon Valley
AI - не микроархитектор, не проектировщик и не верификатор. Это все-лишь гламурный поисковик уже решенных и опубликованных задач. Именно такой вывод следовал из предоставленных мною на конференции SNUG Silicon Valley 2026 фактов как десятки студентов мучали ИИ чтобы решить мои задачки. Одну задачку ИИ решил лишь через полгода после выкладывания решений в интернет, другую за два месяца, потом пошла третья. При этом задачки были довольно банальные - мы в Самсунге даем делать такие статические конвейеры с контролем потока данных практикантам. Вот постер, сопровождающий мою статью:
https://habr.com/ru/articles/1010978/
#SNUG #Synopsys #Silicon_Valley #школа_синтеза_цифровых_схем #SystemVerilog #ASIC #FPGA #Samsung #задачи_на_собеседованиях #VHDL
Sucess!
UtilizationCellUsedAvailableUsageDCCA2563.6%
EHXPLLL1250%
MULT18X18D32810.7%
TRELLIS_COMB125052428851.5%
TRELLIS_FF145242880.6%
TRELLIS_IO101975.1%
TRELLIS_RAMW1200303639.5%
$glbnet$clkp31.01 MHz25 MHz
$glbnet$clkt277.32 MHz250 MHz
module my_code #(
parameter int WIDTH = 640,
parameter int HEIGHT = 480,
parameter int CONSOLE_COLUMNS = WIDTH / 8,
parameter int CONSOLE_ROWS = HEIGHT / 8
)(
input logic clk,
input logic rst,
input int px,
input int py,
input logic hsync,
input logic vsync,
input int col,
input int row,
output int char,
output logic [23:0] foreground_color,
output logic [23:0] background_color
);
// version 2.0
// Fire resolution: 80x60 â scaled to 640x480
localparam int FW = 80;
localparam int FH = 60;
logic [7:0] fire[FH-1:0][FW-1:0];
logic old_vsync;
logic [7:0] lfsr;
// length of div slows frequency of sparks
logic [4:0] spark_div;
logic updating;
logic [6:0] ux;
logic [5:0] uy;
assign char = 0;
assign foreground_color = 24'hFFFFFF;
// Scale VGA pixel to fire coordinates
wire [6:0] fx = px[9:3]; // /8 â 0..79
wire [5:0] fy = py[9:3]; // /8 â 0..59
wire [7:0] v = fire[fy][fx];
// Map intensity to flame color: red dominant, green half, blue low
assign background_color = {v, v >> 1, v >> 3};
integer x,y;
always_ff @(posedge clk) begin
if (rst) begin
old_vsync <= 0;
updating <= 0;
ux <= 0;
uy <= 0;
spark_div <= 0;
lfsr <= 8'hA5;
// for (y=0; y<FH; y=y+1)
// for (x=0; x<FW; x=x+1)
// fire[y][x] <= 0;
end else begin
// start update on vsync rising edge (enter VBLANK)
if (vsync && !old_vsync) begin
updating <= 1;
ux <= 0;
uy <= 0;
end
// scroll fire upward across many clocks
if (updating) begin
// slight decay based on lsb of x coordinate times 2
fire[uy][ux] <= fire[uy+1][ux] - (ux & 1)<<1;
if (ux == FW-1) begin
ux <= 0;
if (uy == FH-2) begin
updating <= 0;
uy <= 0;
end else begin
uy <= uy + 1;
end
end else begin
ux <= ux + 1;
end
end
// bottom sparks (slow, only when not updating)
if (vsync && !old_vsync && !updating) begin
spark_div <= spark_div + 1;
if (!spark_div) begin
lfsr <= {lfsr[6:0],
lfsr[7]^lfsr[5]^lfsr[4]^lfsr[3]};
fire[FH-1][lfsr[6:0]] <= 8'hFF;
end
end
old_vsync <= vsync;
end
end
endmodule

Sucess!
UtilizationCellUsedAvailableUsageDCCA2563.6%
EHXPLLL1250%
TRELLIS_COMB821242883.4%
TRELLIS_FF142242880.6%
TRELLIS_IO101975.1%
$glbnet$clkp40.55 MHz25 MHz
$glbnet$clkt284.41 MHz250 MHz
module my_code #(
parameter int WIDTH = 640,
parameter int HEIGHT = 480,
parameter int CONSOLE_COLUMNS = WIDTH / 8,
parameter int CONSOLE_ROWS = HEIGHT / 8
)(
input logic clk,
input logic rst,
input int px,
input int py,
input logic hsync,
input logic vsync,
input int col,
input int row,
output int char,
output logic [23:0] foreground_color,
output logic [23:0] background_color
);
logic [31:0] frame_counter = '0;
logic old_vsync = '0;
logic [7:0] red, green, blue;
always_comb begin
red = 8'(col * 4);
green = 8'(py);
blue = frame_counter[7:0];
background_color = {red, green, blue};
foreground_color = '1;
char = 0;
end
always_ff @(posedge clk) begin
if (vsync == 1'b0 && old_vsync == 1'b1) begin
frame_counter <= frame_counter + 1;
end
old_vsync <= vsync;
end
endmodule
Sucess!
UtilizationCellUsedAvailableUsageDCCA2563.6%
EHXPLLL1250%
MULT18X18D32810.7%
TRELLIS_COMB1107242884.6%
TRELLIS_FF152242880.6%
TRELLIS_IO101975.1%
$glbnet$clkp40.55 MHz25 MHz
$glbnet$clkt307.69 MHz250 MHz
module my_code #(
parameter int WIDTH = 640,
parameter int HEIGHT = 480,
parameter int CONSOLE_COLUMNS = WIDTH / 8,
parameter int CONSOLE_ROWS = HEIGHT / 8
)(
input logic clk,
input logic rst,
input int px,
input int py,
input logic hsync,
input logic vsync,
input int col,
input int row,
output int char,
output logic [23:0] foreground_color,
output logic [23:0] background_color
);
logic [31:0] frame_counter = '0;
logic old_vsync = '0;
logic [7:0] wave_offset;
logic [7:0] pattern_select;
logic [7:0] hue_shift;
// Create animated wave pattern for background
assign wave_offset = frame_counter[7:0] + col;
// Cycle through different pattern types
assign pattern_select = frame_counter[10:8];
// Hue rotation effect
assign hue_shift = frame_counter[15:8];
always_comb begin
logic [7:0] red, green, blue;
logic [7:0] char_value;
logic [7:0] pattern_output;
// Create cute animated pattern based on row and column
case(pattern_select)
3'b000: pattern_output = (row + col) ^ wave_offset; // Diagonal stripes
3'b001: pattern_output = row * col + frame_counter[7:0]; // Grid pattern
3'b010: pattern_output = ((row ^ col) << 1) + hue_shift; // XOR pattern
default: pattern_output = (row + frame_counter[7:0]) ^ col; // Animated checkerboard
endcase
// RGB color cycling with pattern
red = pattern_output + hue_shift;
green = pattern_output + (hue_shift >> 1);
blue = pattern_output - hue_shift;
background_color = {red, green, blue};
// Character selection creates a cute animation
char_value = ((row * 13 + col * 7) + frame_counter[9:0]) % 256;
// Display cute characters: stars, diamonds, hearts, etc.
if (char_value < 64)
char = 42; // '*' - star
else if (char_value < 128)
char = 43; // '+' - plus
else if (char_value < 192)
char = 46; // '.' - dot
else
char = 35; // '#' - hash
// Foreground color inverts based on background brightness
if ((red + green + blue) > 12'h600)
foreground_color = 24'h000000; // Black text on bright background
else
foreground_color = 24'hFFFFFF; // White text on dark background
end
always_ff @(posedge clk) begin
if (rst) begin
frame_counter <= '0;
old_vsync <= '0;
end else begin
// Increment frame counter on vsync falling edge
if (vsync == 1'b0 && old_vsync == 1'b1) begin
frame_counter <= frame_counter + 1;
end
old_vsync <= vsync;
end
end
endmodule
Sucess!
UtilizationCellUsedAvailableUsageDCCA2563.6%
EHXPLLL1250%
TRELLIS_COMB1245242885.1%
TRELLIS_FF175242880.7%
TRELLIS_IO101975.1%
$glbnet$clkp39.97 MHz25 MHz
$glbnet$clkt293.51 MHz250 MHz
module my_code #(
parameter int WIDTH = 640,
parameter int HEIGHT = 480,
parameter int CONSOLE_COLUMNS = WIDTH / 8,
parameter int CONSOLE_ROWS = HEIGHT / 8
)(
input logic clk,
input logic rst,
input int px,
input int py,
input logic hsync,
input logic vsync,
input int col,
input int row,
output int char,
output logic [23:0] foreground_color,
output logic [23:0] background_color
);
// A "heartbeat" counter that ticks every frame to create a subtle animation effect
logic [31:0] frame_counter = '0;
logic old_vsync = '0;
// Separate RGB channels for more creative color mixing
logic [7:0] r_val, g_val, b_val;
// A "mood" counter that cycles through different color palettes based on row position
logic [31:0] mood_counter = '0;
always_comb begin
// Calculate dynamic colors based on input coordinates and frame time
// Red channel: influenced by column position and frame counter low bits
r_val = 8'({col[2:0], frame_counter[7:0][3:0]});
// Green channel: influenced by row position and mood counter
g_val = 8'({row[1:0], mood_counter[15:14]});
// Blue channel: a mix of all inputs for a "glow" effect
b_val = 8'(frame_counter[7:0][6:4] ^ row[2:0]);
background_color = {r_val, g_val, b_val};
// Foreground is always white with a slight tint based on frame counter
foreground_color = '1;
if (frame_counter[31:28]) begin
foreground_color = 24'b0000_0000_0000_0000_0000_0001; // Pure white
end else begin
foreground_color = 'hFFFFFF; // Light cyan tint
end
char = row + col;
end
always_ff @(posedge clk) begin
if (rst == 1'b1) begin
frame_counter <= '0;
mood_counter <= '0;
end else if (vsync == 1'b0 && old_vsync == 1'b1) begin
// Increment counters on every new video frame
frame_counter <= frame_counter + 1;
mood_counter <= mood_counter + 1;
end
old_vsync <= vsync;
end
endmodule
Sucess!
UtilizationCellUsedAvailableUsageDCCA2563.6%
EHXPLLL1250%
TRELLIS_COMB855242883.5%
TRELLIS_FF143242880.6%
TRELLIS_IO101975.1%
$glbnet$clkp38.29 MHz25 MHz
$glbnet$clkt293.69 MHz250 MHz
module my_code #(
parameter int WIDTH = 640,
parameter int HEIGHT = 480,
parameter int CONSOLE_COLUMNS = WIDTH / 8,
parameter int CONSOLE_ROWS = HEIGHT / 8
)(
input logic clk,
input logic rst,
input int px,
input int py,
input logic hsync,
input logic vsync,
input int col,
input int row,
output int char,
output logic [23:0] foreground_color,
output logic [23:0] background_color
);
logic [31:0] frame_counter = 0;
logic old_vsync = 0;
logic [7:0] red, green, blue;
// Define a simple character mapping for demonstration.
logic [7:0] char_code;
always_comb begin
// Calculate the character code based on pixel coordinates.
// This creates a very basic "pixelated" text effect.
char_code = (px % 8) << 4 | (py % 8); // Combine X and Y into a single char code
// Simple color palette - Red for important, Green for normal, Blue for background
red = 8'(col * 2); // More intense red based on column.
green = 8'(py); // Normal green for the row.
blue = frame_counter[7:0]; // Blue changes with the frame counter
background_color = {red, green, blue};
foreground_color = char_code[7:0] ? 1'b1 : 1'b0; // Turn on foreground only when a character is being drawn.
char = char_code;
end
always_ff @(posedge clk) begin
if (vsync == 1'b0 && old_vsync == 1'b1) begin
frame_counter <= frame_counter + 1;
end
old_vsync <= vsync;
end
endmodule