(no commit message)
[libreriscv.git] / HDL_workflow.mdwn
index 3a9e574e3e67950f0da37cc16f5fc34c429c4d21..69b15f997f46bc6c68fa460bf2477c4b1be08447 100644 (file)
@@ -6,11 +6,65 @@ It is particularly important to bear in mind that we are not just "developing co
 
 It is also important to appreciate and respect that we are funded under NLNet's Privacy and Enhanced Trust Programme <http://nlnet.nl/PET>. Full transparency, readability, documentation, effective team communication and formal mathematical proofs for all code at all levels is therefore paramount.
 
+# Collaboration resources
+
+## Main contact method: mailing list
+
+To respect the transparency requirements, conversations need to be public and archived (i.e not skype, not telegram, not discord, and anyone seriously suggesting slack will be thrown to the lions).  Therefore we have a
+mailing list. Everything goes through there. <http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev> therefore please do google "mailing list etiquette" and at the very minimum look up and understand the following:
+
+* This is a technical mailing list with complex topics. Top posting is completely inappropriate. Don't do it unless you have mitigating circumstances, and even then please apologise and explain ("hello sorry using phone at airport flight soon, v. quick reply: ....")
+* Always trim context but do not cut excessively to the point where people cannot follow the discussion.  Especially do not cut the attribution ("On monday xxx wrote")
+* Use inline replies i.e. reply at the point in the relevant part of the conversation, as if you were actually having a conversation.
+* Follow standard IETF reply formatting, using ">" for cascaded indentation of other people's replies.  If using gmail, please: SWITCH OFF RICH TEXT EDITING.
+* Please for god's sake do not use "my replies are in a different colour". Only old and highly regarded people still using AOL are allowed to get away with that (such as Mitch).
+* Start a new topic with a relevant subject line. If an existing discussion changes direction, change the subject line to reflect the new topic (or start a new conversation entirely, without using the "reply" button)
+* DMARC is a pain on the neck. Try to avoid GPG signed messages. sigh.
+* Don't send massive attachments. Put them online (no, not on facebook or google drive or anywhere else that demands privacy violations) and provide the link.  Which should not require any kind of login to access. ask the listadmin if you don't have anywhere suitable: FTP access can be arranged.
+
+If discussions result in any actionable items, it is important not to lose track of them. Create a bugreport, find the discussion in the archives <http://lists.libre-riscv.org/pipermail/libre-riscv-dev/>, and put the link actually in the bugtracker as one of the comments.  
+
+At some point it may become better to use  <http://bugs.libre-riscv.org> itself to continue the discussion rather than to keep on dropping copies of links into the bugtracker.  The bugtracker sends copies of comments *to* the list however this is 'one-way' (note from lkcl: because this involves running an automated perl script from email, on every email, on the server, that is a high security risk, and i'm not doing it. sorry.)
+
+Also, please do not use the mailing list as an "information or document store or poor-man's editor". We have the wiki for that.  Edit a page and tell people what you did (summarise rather than drop the entire contents at the list) and include the link to the page.
+
+Or, if it is more appropriate, commit a document (or source code) into the relevant git repository then look up the link in the gitweb source tree browser and post that (in the bugtracker or mailing list) See <http://git.libre-riscv.org>
+## Bugtracker
+
+bugzilla. old and highly effective. sign up in the usual way. any problems, ask on the list.
+
+Please do not ask for the project to be transferred to github or other proprietary nonfree service "because it's soooo  convenient", as the lions are getting wind and gout from overfeeding.
+
+## ikiwiki
+
+Runs the main libre-riscv.org site (including this page). effective, stunningly light on resources, and uses a git repository not a database.  That means it can be edited offline.
+
+Usual deal: register an account and you can start editing and contributing straight away.
+
+Hint: to create a new page, find a suitable page that would link to it, first, then put the link in of the page you want to create, as if the page already exists.  Save that page, and you will find a questionmark next to the new link you created.  click that link, and it will fire up a "create new page" editor.
+
+Hint again: the wiki is backed by a git repository.  Don't go overboard but at the same time do not be afraid that you might "damage" or "lose" pages.  Although it would be a minor pain, the pages can always be reverted or edited by the sysadmins to restore things if you get in a tiz.
+
+Assistance in creating a much better theme greatly appreciated.
+
+## git
+
+we use git. more on this below.  we also use gitolite3 running on a dedicated server.  again, it is extremely effective and low resource utilisation.  reminder: lions are involved if github is mentioned.
+
+gitweb is provided which does a decent job. <http://git.libre-riscv.org>
+
+## server
+
+as an aside: all this is "old school" and run on a single core 512MB VM with only a 20GB HDD allocation. it costs only 8 GBP per month from mythic-beasts and means that the project is in no way dependent on anyone else - not microsoft, not google, not facebook, not amazon.
+
+we tried gitlab. it didn't go well.
+
 # Hardware
 
 RAM is the biggest requirement. Minimum 16GB, the more the better (32 or 64GB starts to reach "acceptable" levels.  Disk space is not hugely critical: 256GB SSD should be more than adequate.  Simulations and FPGA compilations however are where raw processing power is a must.  High end Graphics Cards are nonessential.
 
-What is particularly useful is to have not only hi-res screens (curved is *strongly* recommended if the LCD is over 24in wide, to avoid eyeballs going "prism" through longterm use), and to have several of them: the more the better.  Either a DisplayLink UD160A (or more modern variant) or simply using a second (lower spec hardware) machine is really effective.
+What is particularly useful is to have hi-res screens (curved is *strongly* recommended if the LCD is over 24in wide, to avoid eyeballs going "prism" through longterm use), and to have several of them: the more the better.  Either a DisplayLink UD160A (or more modern variant) or simply using a second machine (lower spec hardware because it will run editors) is really effective.
 
 Also it is really recommended to have a UHD monitor (4k - 3840x2160), or at least 2560x1200.  If given a choice, 4:3 aspect ratio is better than 16:9 particularly when using several of them. However, caveat (details below): please when editing do not assume that everyone will have access to such high resolution screens.
 
@@ -30,9 +84,9 @@ Where the problems occur with fullscreen editor usage is when a project is split
 
 (hint/tip: fvwm2 set up with "mouse-over to raise focus, rather than additionally requiring a mouseclick, can save a huge amount of cumulative development time here, switching between editor terminal(s) and the command terminals).
 
-Once this becomes necessary, it it turn implies that having greater than 80 chars per line - and running editors fullscreen -is a severe hindance to an essential *and highly effective* workflow technique.
+Once this becomes necessary, it it turn implies that having greater than 80 chars per line - and running editors fullscreen - is a severe hindance to an essential *and highly effective* workflow technique.
 
-Additionally, care should be taken to respect that not everyone will have 200+ column editor windows. They may only have a 1280 x 800 laptop which barely fits 2 80x53 xterms side by side.  Consequently, having excessively long functions is also a hindrance to others, as such developers with limited screen resources would need to continuously page-up and page-down to read the code even of a single function, in full.
+Additionally, care should be taken to respect that not everyone will have 200+ column editor windows and the eyesight of a hawk. They may only have a 1280 x 800 laptop which barely fits two 80x53 xterms side by side.  Consequently, having excessively long functions is also a hindrance to others, as such developers with limited screen resources would need to continuously page-up and page-down to read the code even of a single function, in full.
 
 This helps explain in part, below, why compliance with pep8 is enforced, including its 80 character limit.  In short: not everyone has the same "modern" GUI workflow or has access to the same computing resources as you, so please do respect that.
 
@@ -44,9 +98,17 @@ Whilst many resources online advocate "sudo" in front of all root-level commands
 * apt-get install vim exuberant-ctags
 * apt-get install build-essential
 * apt-get install git python3.7 python3.7-dev python-nosetest3
-* apt-get install graphviz xdot
+* apt-get install graphviz xdot gtkwave
 * return to user prompt (ctrl-d)
 
+This will get you python3 and other tools that are needed. graphviz is essential for showing the interconnections between cells, and gtkwave is essential for debugging.
+
+## git
+
+Look up good tutorials on how to use git effectively.  There are so many it is hard to recommend one. This is however essential. If you are not comfortable with git, and you let things stay that way, it will seriously impede development progress.
+
+If working all day you should expect to be making at least two commits per hour, so should become familiar with it very quickly.  If you are *not* doing around 2 commits per hour, something is wrong and you should read the workflow instructions below more carefully, and also ask for advice on the mailing list.
+
 ## yosys
 
 Follow the source code (git clone) instructions here: <http://www.clifford.at/yosys/download.html>
@@ -71,11 +133,16 @@ nmigen may be installed as follows:
 * python3 setup.py develop
 * ctrl-d
 
-testing can then be carried out with "python3 setp.py test"
+testing can then be carried out with "python3 setup.py test"
+
+## Softfloat and sfpy
+
+These are a test suite dependency for the ieee754fpu library, and will be changed in the future to use Jacob's algorithmic numeric library.  In the meantime the README describing the process is here:
+<https://git.libre-riscv.org/?p=ieee754fpu.git;a=blob;f=README.md;h=d219864a341e4b656680de476e385b6a7f70fb9b;hb=HEAD>
 
 # Registering for git repository access
 
-After going through the onboarding process and having agreed to take responsibility for certain tasks, ask on the mailing list for git repository access, sending in a public key (id_rsa.pub). If you do not have one generate it with ssh-keygen -t rsa.
+After going through the onboarding process and having agreed to take responsibility for certain tasks, ask on the mailing list for git repository access, sending in a public key (id_rsa.pub). If you do not have one then generate it with ssh-keygen -t rsa. You will find it in ~/.ssh
 
 NEVER SEND ANYONE THE PRIVATE KEY.  By contrast the public key, on account of being public, is perfectly fine to make... err... public.
 
@@ -89,19 +156,36 @@ you can clone any of the repos at http://git.libre-riscv.org:
 
     git clone gitolite3@git.libre-riscv.org:REPONAME.git
 
+# Checking out the HDL repositories
+
+* mkdir ~/src
+* cd !$
+* git clone gitolite3@git.libre-riscv.org:soc.git
+* git clone gitolite3@git.libre-riscv.org:ieee754fpu.git
+
+In each of these directories, track down the setup.py file, then, as root (sudo bash) run the following:
+
+* python3 setup.py develop
+
+The reason for using "develop" mode is that the code may be edited in-place yet still imported "globally".  There are variants on this theme for multi-user machine use however it is often just easier to get your own machine these days.
+
+If "python3 setup.py install" is used it is a pain: edit, then install. edit, then install. It gets extremely tedious, hence why "develop" was created.
+
 # Development Rules
 
 team communication:
 
 * communicate on the mailing list or the bugtracker an intent to take responsibility for a particular task.
 * assign yourself as the bug's owner
-* *keep in touch* about what you are doing, and why.
-* if you cannot do sonething that you gave taken responsibility for, then unless it is a dire emergency please say so, on-list. we won't mind. we'll help sort it out.
+* *keep in touch* about what you are doing, and why you are doing it.
+* if you cannot do something that you have taken responsibility for, then unless it is a dire personal emergency please say so, on-list. we won't mind. we'll help sort it out.
+
+regarding the above it is important that you read, understand, and agree to the [[charter]] because the charter is about ensuring that we operate as an effective organisation.  It's *not* about setting rules and meting out punishment".
 
 for actual code development:
 
 * **do not commit autogenerated output**. write a shell script and commit that, or add a Makefile to run the command that generates the output, but **do not** add the actual output of **any** command to the repository.  ever.  this is really important.  even if it is a human-readable file rather than a binary object file.
-* if the command needed to create any given autogenerated output is not currently in the list of dependencies, first consult on the list if it is okay to make that command become a hard dependency of the project (hint: java, node.js php and .NET commands will cause delays in responses due to list participants laughing hysterically too much), and after a decision is made, document the dependency and how its source code is obtained and built.
+* if the command needed to create any given autogenerated output is not currently in the list of kniwn project dependencies, first consult on the list if it is okay to make that command become a hard dependency of the project (hint: java, node.js php and .NET commands may cause delays in response time due to other list participants laughing hysterically), and after a decision is made, document the dependency and how its source code is obtained and built (hence why it has to be discussed)
 * if you find yourself repeating commands regularly, chances are high that someone else will need to run them, too. therefore, put them into a .sh shell script (and/or a Makefile) and document them at the very minimum in README or INSTALL.txt or somewhere in a docs folder as appopriate.  if unsure, ask on the mailing list for advice.
 * plan in advance to write not just code but a full test suite for that code.  **this is not optional**. large python projects that do not have unit tests **FAIL**.
 * edit files making minimal *single purpose* modifications (even if it involves multiple files. Good extreme example: globally changing a function name across an entire codebase is one purpose, one commit, yet hundreds of files).
@@ -148,6 +232,5 @@ The reasons for doing a proper modularisation job are several-fold:
 Find appropriate tutorials for nmigen and yosys, as well as symbiyosys.
 
 * Although a verilog example this is very useful to do <https://symbiyosys.readthedocs.io/en/latest/quickstart.html#first-step-a-simple-bmc-example>
-* There exist several nmigen examples which are also executable <https://github.com/m-labs/nmigen/tree/master/examples/>
 * This tutorial looks pretty good and will get you started <http://blog.lambdaconcept.com/doku.php?id=nmigen:nmigen_install> and walks not just through simulation, it takes you through using gtkwave as well.
-
+* There exist several nmigen examples which are also executable <https://github.com/m-labs/nmigen/tree/master/examples/> exactly as described in the above tutorial (python3 filename.py -h)