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]..