RISC-V CPU 설계 (0)
·
Hardware/RISC-V Project
뭔가 취준 + 교육 준비 같은걸 하면서 머리가 정리가 안되고 너무 복잡해서RISC-V 구조를 갖는 CPU나 하나 만들어보자는 생각이 들었다. 물론 나의 선생님 GPT와 함께 만들거지만 ^^ 전체적인 아웃라인설계 목표32bit RISC-V Structure기본 구조5-stage Pipeline: Fetch - Decode - Execute - Memory - Write Back파이프라인 구성 요소Register FileALUMemory InterfaceControl UnitPipeline Register파이프라인 Hazard 처리Control Logic & FSM검증 & 시뮬레이션구현디버깅 & 최종 검증
Verilog [ generate와 always@(*) ] 차이점
·
Hardware/ETC.
generate반복적으로 독립된 하드웨어를 생성하드웨어 자원 증가같은 논리 회로가 여러 번 복사always @(*)Combinational Logic입력 변화에 따라 동작이 결정되며, 최적화된 회로로 구현
HDLBits - Vectorr
·
HDLBits/Verilog
Given an 8-bit input vector [7:0], reverse its bit ordering.그냥 뒤집?으라는 문제단순히 생각해서 [0:7]을 하면 오류가 난다. 뒤집어서 선언하는건 막아놨기 때문일단 하나씩 이렇게 적어도 되긴한다.module top_module( input [7:0] in, output [7:0] out); assign out = {in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]};endmodule근데.. 많이 귀찮다많아지면? 다 적을수는 없으니까 해결법 중 always문안에 for 루프를 사용하는 것도 괜찮다.module top_module( input [7:0] in, output [7..
HDLBits - Vector3
·
HDLBits
Concatenation needs to know the width of every component(or how would you know the length of the result?).Thus, {1, 2, 3} is illegal and results in the error message:unsized constants are not allowed in concatenations.{ } 를 사용해서 여러 비트를 연결할 때 bit의 크기를 무조건 명시해야한다.주어진 32-bits를 아래의 w,x,y,z로 재조정하는 문제이다.하나로 합친다음에 갈라서 assign 하였다.module top_module ( input [4:0] a, b, c, d, e, f, output [7:0] w, x,..
HDLBits - Gates4
·
HDLBits/Verilog
Build a combinational circuit with four inputs, in[3:0]There are 3 outputs:out_and: output of a 4-input AND gate.out_or: output of a 4-input OR gate.out_xor: output of a 4-input XOR gate.3개의 Output을 위에서 말하는 Gate들로 만드는 문제Bit들을 하나씩 떨어뜨리고 연산하면 끝module top_module( input [3:0] in, output out_and, output out_or, output out_xor); assign out_and = in[0] & in[1] & in[2] & in[3]; assign..
HDLBits - Vectorgates
·
HDLBits/Verilog
Build a circuit that has two 3-bit inputs that computesthe bitwise-OR of the two vectors,the logical-OR of the two vectors,the inverse (NOT) of both vectors.Place the inverse of b in the upper half of out_not (i.e., bits [5:3]), and the inverse of a in the lower half.적힌대로 2개의 3-bit입력을 output으로 만드는 문제Bitwise와 Logical Operators의 차이점은단순 비트 연산과, 논리 연산 이라는 것에 차이가 있다.module top_module( input [2:0]..
Verible - 설치 및 사용법
·
Hardware/ETC.
Verible?SystemVerilog 코드의 스타일 점검, 포매팅, 파싱, linting 및 기타 개발 워크플로를 지원하는 오픈소스 도구 모음주로 Chips Alliance에서 개발SystemVerilog 코드를 효율적으로 다루기 위한 도구를 제공기능코드 포매터 (Code Formatter)SystemVerilog 코드를 스타일 규칙에 맞게 자동으로 포맷합니다.일관된 코딩 스타일을 유지하고 코드 가독성을 높이기 위한 도구입니다.Linting (스타일 체크 및 분석)SystemVerilog 코드의 스타일 및 잠재적 문제를 감지합니다.팀 또는 프로젝트에서 정의한 코딩 규칙에 따라 규칙 기반 점검을 수행합니다.구문 파싱 및 AST 생성SystemVerilog 코드의 Abstract Syntax Tree (A..
HDLBits-Vector2
·
HDLBits/Verilog
이제는 Vector의 그냥 활용이 문제로 나오는듯? 하다A 32-bit vector can be viewed as containing 4 bytes (bits [31:24], [23:16], etc.).Build a circuit that will reverse the byte ordering of the 4-byte word.32-bit Vector는 4 bytes를 포함한다. byte는 8bit니까.. AaaaaaaaBbbbbbbbCcccccccDddddddd => DdddddddCcccccccBbbbbbbbAaaaaaaa이걸 이렇게 만들라는 문제다.8bit 단위로 떼서 옮기면 될 것 같다.물론 바로 in에서 out으로 assign하면 되지만이렇게 하면 좀더 가독성이 좋고 나중에 기억하거나 수정할때 ..