StevenChou43

@StevenChou43

Joined on Oct 20, 2021

  • contributed by < StevenChou499 > 進行 第 12 週測驗題第二題的延伸問題。過程中參照第 13 週測驗題第一/二題,嘗試開發出高效的 ring buffer。 相關資訊:[ ] ringbuffer 報告 [ ] Super Fast Circular Ring Buffer Using Virtual Memory trick [ ] Using black magic to make a fast circular buffer [ ] linear_ringbuffer/include/bev/linear_ringbuffer.hpp [ ] wuffs/script/mmap-ring-buffer.c
     Like 4 Bookmark
  • ModelSim 在終端機使用方法 vlib <name> : 建立名為 name 的設計函式庫。 vlog <files> : 使用 ModelSim 編譯所有 files 的檔案。 vsim <top_level_module> : 使用 ModelSim 開啟編譯完成的檔案。 在 ModelSim 中輸入 run -all : 使用 vsim 開啟檔案後,輸入 run -all 可以執行模擬。 以下為範例 : PS C:\Users\StevenChou\Desktop\Verilog_practice\Chp5\Q3> vlib work ** Warning: (vlib-34) Library already exists at "work".
     Like 1 Bookmark
  • 第一個成功版本 程式碼 : `timescale 1ns/10ps module ATCONV( input clk, input reset, output reg busy, input ready,
     Like  Bookmark
  • HDLBits 連結 : https://hdlbits.01xz.net/wiki/Main_Page Getting Started Getting Started :::spoiler 解答 module top_module( output one ); assign one = 1'b1;
     Like  Bookmark
  • 使用 Verilog 的基本概念 接線 (Nets) 接線是連接硬體元素之點。接線之最主要的關鍵字為 wire ,接線預設為一個位元,並且預設值是 z (除了 trireg 接線,其預設值為 x) ,接線的值由它的驅動信號而來。若接線沒有驅動信號,則其值為 x 。 :::info 在提及接線的時候,我們可以使用 Net 與 wire ,但是真正在 Verilog 只有 wire 的關鍵字。 在 Verilog 中,高阻抗 z 可以使用 ? 替代。 :::
     Like 5 Bookmark
  • contributed by < StevenChou499 > 實驗環境 $ gcc --version gcc (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0 $ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian
     Like  Bookmark
  • contributed by <StevenChou499> Question Selection Question I choose question from 蘇勇達 Length of Last Word, which is LeetCode 58 . Motivation The reason I choose this question is because there are two loop using in assembly code, which is a great way for practicing some optimizing skills. C code (Modified)
     Like 1 Bookmark
  • contributed by < StevenChou499 > Binary Search I choose Problem 704, which is at easy difficulty. Problem description : Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then return its index. Otherwise, return -1. You must write an algorithm with O(log n) runtime complexity.
     Like  Bookmark
  • contributed by < StevenChou499 > 作業需求 測驗題目 測驗 1 考慮以下對二個無號整數取平均值的程式碼: #include <stdint.h>
     Like  Bookmark
  • contributed by < StevenChou499 > 實驗環境 $ gcc --version gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 $ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian
     Like  Bookmark
  • 測驗 1 利用上述 SIMD within a register (SWAR) 的技巧,我們可改寫為以下 memchr_opt 函式: #include <stddef.h> #include <stdint.h> #include <limits.h> #include <string.h> /* Nonzero if either X or Y is not aligned on a "long" boundary */
     Like  Bookmark
  • contributed by < StevenChou499 > 作業需求 測驗題目 測驗 1 延伸第 3 週測驗題的測驗 7 ,已知輸入必為大於 0 的數值 (即 x > 0 ),以下程式碼可計算$[\log _{2} (x)]$,,也就是 ceil 和 log2 的組合並轉型為整數: int ceil_log2(uint32_t x)
     Like  Bookmark
  • contributed by < StevenChou499 > 作業需求 測驗題目 測驗 1 在 Linux 核心原始程式碼,include/linux/bitfield.h 提及一個巨集 GENMASK,其作用是依據給定的範圍,產生連續的 bitmask,例如: GENMASK(6, 4) 產生 01110000
     Like  Bookmark