Skip to content

Instantly share code, notes, and snippets.

:octocat:
Focusing

Yuan He lenage

:octocat:
Focusing
Block or report user

Report or block lenage

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View RISC-V.md

Foreward

This document was originally written several years ago. At the time I was working as an execution core verification engineer at Arm. The following points are coloured heavily by working in and around the execution cores of various processors. Apply a pinch of salt; points contain varying degrees of opinion.

It is still my opinion that RISC-V could be much better designed; though I will also say that if I was building a 32 or 64-bit CPU today I'd likely implement the architecture to benefit from the existing tooling.

Mostly based upon the RISC-V ISA spec v2.0. Some updates have been made for v2.2

Original Foreword: Some Opinion

The RISC-V ISA has pursued minimalism to a fault. There is a large emphasis on minimizing instruction count, normalizing encoding, etc. This pursuit of minimalism has resulted in false orthogonalities (such as reusing the same instruction for branches, calls and returns) and a requirement for superfluous instructions which impacts code density both in terms of size and

@lenage
lenage / gist:4b9315654af7064b13b7b037135eaf88
Created Oct 26, 2018 — forked from jimbojsb/gist:1630790
Code highlighting for Keynote presentations
View gist:4b9315654af7064b13b7b037135eaf88

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

View main.css
/* main.css */
body { display: none}
@lenage
lenage / search_domain.py
Created Nov 30, 2012 — forked from lintianzhi/search_domain.py
search availible domain name
View search_domain.py
#!/usr/bin/python
#coding=utf-8
import urllib
import urllib2
import re
import threading
import Queue
url = 'https://who.is/whois/name_search/'
@lenage
lenage / wait_until.rb
Created Nov 5, 2012 — forked from metaskills/wait_until.rb
Never sleep() using Capybara!
View wait_until.rb
# Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations?
describe 'Modal' do
should 'display login errors' do
visit root_path
click_link 'My HomeMarks'
within '#login_area' do
fill_in 'email', with: 'will@not.work'
fill_in 'password', with: 'test'
@lenage
lenage / gist:1924529
Created Feb 27, 2012 — forked from toamitkumar/gist:952211
Inspect and test routes on console (Rails 3)
View gist:1924529
$ rails console
Loading development environment (Rails 3.0.6)
ruby-1.8.7-p334 :001 > r = Rails.application.routes
Gives you a handle of all the routes (config/routes.rb)
#Inspect a named route:
ruby-1.8.7-p334 :005 > r.recognize_path(app.destroy_user_session_path)
=> {:action=>"destroy", :controller=>"sessions"}
@lenage
lenage / commit-msg
Created Aug 3, 2011 — forked from mmrwoods/commit-msg
Commit and merge hooks for Github and Lighthouse
View commit-msg
#!/usr/bin/env ruby
# When committing directly to master, look for lighthouse ticket number in commit msg and, if necessary, append in format recognised by github
# When committing to a topic/feature branch, barf if the branch name doesn't include a ticket number that can be parsed by the post-merge hook
# Note: this hook only applies when -m option used and can also be skipped by using --no-verify option
COMMIT_MASTER_STATE = 'coding-done'
branchname = `git branch --no-color 2> /dev/null`[/^\* (.+)/, 1]
@lenage
lenage / gist:1115580
Created Jul 30, 2011
Ruby Style Guide
View gist:1115580
Original Source: https://github.com/chneukirchen/styleguide
= Christian Neukirchen's Ruby Style Guide
You may not like all rules presented here, but they work very well for
me and have helped producing high quality code. Everyone is free to
code however they want, write and follow their own style guides, but
when you contribute to my code, please follow these rules:
You can’t perform that action at this time.