본문 바로가기

Language/Verilog & SV26

[Verilog & SV] Function vs Task 목차Function입력에 대해 일부 처리를 수행하고 단일 값을 반환합니다.​Task function보다 일반적이며 여러 결과 값을 계산하고 출력 및 입력 유형 인수를 사용하여 반환할 수 있습니다. Function vs TaskFunction Taskdelay, event, timing control를 사용할 수 없습니다. (no use NBA)delay, event, timing control를 사용할 수 있습니다 (use NBA)단일 값을 반환하여 입력 값에 응답합니다. 함수는 식에서 피연산자로 사용됩니다(함수 자체에 값 반환).여러 목표를 지원하기 위해 출력 또는 출력 포트를 통해서만 여러 결과 값(작업으로 반환되는 값 없음)하나 이상의 inupt 유형 인수가 있어야하고 output이나 inout 유.. 2025. 4. 7.
[System Verilog] Event? Event?목차 IPC?Inter Process Communication (IPC)모든 데이터의 교환 및 제어 동기화를 의미합니다. 기본적인 순서부터, 여러 thread가 DUT와 같은 단일 resource에 접근할 때 권한 분배 등이 이에 해당합니다.System Verilog에서 IPC를 구현하기 위해 사용Event, Semaphore, Mailbox  Event? 남자친구의 연락을 기다리고 있는 여자친구가 있다고 해봅시다. 남자친구의 연락 ≒ event남자친구가 연락을 하는 순간 ≒     event기다리고 있는 여자친구 ≒ @event   blocking or non-blocking를 이용해서 trigger 가능event의 trigger를 wait하고 뒤 구문을 차단하는 두가지 방법@eventwai.. 2025. 4. 4.
[Verilog] Sequential/parallel block 목차Sequential block(순차블록): begin-endDeclaration of data, local parameter, parameter, let, and statementsr은 순차적으로 #d마다 변화합니다.parameter d = 50;reg [7:0] r; // a waveform controlled begin // by sequential delay #d r = ’h35; #d r = ’hE2; #d r = ’h00; #d r = ’hF7; #d -> end_wave;// trigger an event // called end_waveend Parallel block(병렬블록): fork-joinThe timin.. 2025. 1. 28.
[System Verilog] Bitwise, 감소 연산자(Reduction Operators) 목차 Reduction Operator Reduction Operator들은 벡터를 단 하나의 비트로만 줄입니다.Bitwise 연산입니다.If there are the characters Z and X, the result can be a known value.Example​ a = 5’b10101 b = 4’b0011 c = 3’bz00 d = 3’bx011 Character Operation performed Example Type&And all bits&a = 1’b0, &d = 1’b0Unary~&Nand all bits~&a = 1’b1Unary|Or all bits|a = 1’b1, |c = 1’bXUnary~|Nor all bits~|a= 1’b0Unary^Xor all bits^a = 1’.. 2024. 11. 16.
[Verilog Problem] NOR Gate Problem descriptionmodule은 TOP이고 Input inA, inB Output out를 가지고 있습니다.inA와 inB는 NOR Gate를 통해 out으로 나갑니다.Codemodule TOP ( input inA, input inB, output out); assign out=~(inA|inB);endmoduleDescription"|"는 bit, "||"는 논리 연산자 입니다."~|"은 NOR bit 연산자 입니다. 2024. 5. 24.
[Verilog Problem] XNOR Gate Problem descriptionmodule은 TOP이고 Input inA, inB Output out를 가지고 있습니다.inA와 inB는 XNOR Gate를 통해 out으로 나갑니다.Codemodule TOP ( input inA, input inB, output out); assign out=~(inA^inB);//assign out = inA~^inB;endmoduleDescription"^" XOR bit 연산자입니다."~^", "^~" XNOR bit 연산자입니다. 2024. 5. 24.
반응형