Skip to content

Commit

Permalink
Clean comments a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
abejgonzalez committed Feb 13, 2019
1 parent da6f1b9 commit 5b355b0
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 30 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/bpu/bpd-pipeline.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import boom.common._
import boom.exu.BranchUnitResp

/**
* Give this to each instruction/uop and pass this down the pipeline to the branch-unit
* Give this to each instruction/uop and pass this down the pipeline to the branch unit
* This covers the per-instruction info on all cfi-related predictions.
*/
class BranchPredInfo(implicit p: Parameters) extends BoomBundle()(p)
Expand All @@ -51,7 +51,7 @@ class BranchPredInfo(implicit p: Parameters) extends BoomBundle()(p)
}

/**
* Wraps the BTB and BPD into a pipeline that is parallel with the Fetch pipeline.
* Wraps the BoomBTB and BrPredictor into a pipeline that is parallel with the Fetch pipeline.
*
* @param fetch_width # of instructions fetched
*/
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/bpu/bpd/br-predictor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ class RestoreHistory(implicit p: Parameters) extends BoomBundle()(p)
}

/**
* Abstract Branch Predictor class. Exposes the necessary signals for different BPD
* types to "hook" into BOOM nicely.
* Abstract top level branch predictor class. Exposes the necessary signals for different
* branch predictor types to be instantiated into BOOM.
*
* @param fetch_width # of instructions fetched
* @param history_length length of the GHR
Expand Down Expand Up @@ -269,7 +269,7 @@ abstract class BrPredictor(
}

/**
* Companion object to the Abstract Branch Predictor. Return the desired branch
* Companion object to the abstract branch bredictor. Return the desired branch
* predictor based on the provided parameters.
*/
object BrPredictor
Expand Down
7 changes: 3 additions & 4 deletions src/main/scala/bpu/bpd/gshare/gshare.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import boom.common._
import boom.util.{ElasticReg, Fold}

/**
* GShare configuration parameters used in configs
* GShare configuration parameters used in configurations
*
* @param enabled using GShare?
* @param history_length length of the GHR
Expand All @@ -41,7 +41,7 @@ case class GShareParameters(
)

/**
* Trait to inherit parameters from the config
* Trait to inherit parameters from the configuration
*/
trait HasGShareParameters extends HasBoomCoreParameters
{
Expand Down Expand Up @@ -82,7 +82,7 @@ class GShareResp(val fetch_width: Int, val idx_sz: Int) extends Bundle

/**
* Companion object to GShareBrPredictor to get the the size of the
* BPD resp.
* branch predictor response
*/
object GShareBrPredictor
{
Expand Down Expand Up @@ -264,4 +264,3 @@ class GShareBrPredictor(
" kB) GShare Predictor, with " + history_length + " bits of history for (" +
fetch_width + "-wide fetch) and " + nSets + " entries."
}

10 changes: 6 additions & 4 deletions src/main/scala/bpu/bpd/simple-predictors/base-only.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import freechips.rocketchip.config.{Parameters, Field}
import boom.util.ElasticReg

/**
* BaseOnly predictor configuration parameters used in configs
* BaseOnly predictor configuration parameters used in configurations
*
* @param enabled using BaseOnly predictor?
*/
Expand All @@ -38,7 +38,8 @@ case class BaseOnlyParameters(
)

/**
* Dummy response for commit (nothing to commit since you are just using the BIM
* Dummy response for commit (nothing to commit since you are just using the
* bi-modal table
*/
class BaseOnlyResp() extends Bundle
{
Expand All @@ -48,7 +49,7 @@ class BaseOnlyResp() extends Bundle

/**
* Companion object to BaseOnlyBrPredictor to get the the size of the
* BPD resp.
* branch predictor response
*/
object BaseOnlyBrPredictor
{
Expand All @@ -60,7 +61,8 @@ object BaseOnlyBrPredictor
}

/**
* Class to create a BaseOnlyBr Predictor
* Class to create a BaseOnlyBr predictor that only uses
* the BoomBTB's bi-modal table
*
* @param fetch_width # of instructions fetched
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import boom.exu.BranchUnitResp
import boom.util.ElasticReg

/**
* Create a null branch predictor
* Act as a "null" branch predictor (it makes no predictions).
* Create a null branch predictor that makes no predictions
*
* @param fetch_width # of instructions fetched
* @param history_length length of the BHR in bits
Expand All @@ -45,7 +44,7 @@ class NullBrPredictor(
case object RandomBpdKey extends Field[RandomBpdParameters]

/**
* Random predictor configuration parameters used in configs
* Random predictor configuration parameters used in configurations
*
* @param enabled using Random predictor?
*/
Expand All @@ -55,7 +54,7 @@ case class RandomBpdParameters(

/**
* Companion object to RandomBrPredictor to get the the size of the
* BPD resp.
* branch predictor response
*/
object RandomBrPredictor
{
Expand All @@ -67,7 +66,7 @@ object RandomBrPredictor
}

/**
* Class to create a Random predictor Provide a branch predictor that generates random predictions. Good for testing!
* Class to create a Random predictor that generates random predictions. Good for testing!
*
* @param fetch_width # of instructions fetched
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/bpu/bpd/tage/tage-table.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import freechips.rocketchip.util.Str
import boom.common._

/**
* The IO bundle to connect the Tage Table to the Tage predictor top
* IO bundle to connect the TAGE table to the TAGE predictor top
*
* @param fetch_width # of instructions fetched
* @param index_sz ...
Expand Down
7 changes: 3 additions & 4 deletions src/main/scala/bpu/bpd/tage/tage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import boom.common._
import boom.util.{ElasticReg, Fold}

/**
* TAGE parameters used in configs
* TAGE parameters used in configurations
*
* @param enabled using TAGE?
* @param num_tables ...
Expand All @@ -58,7 +58,7 @@ case class TageParameters(

/**
* Set of data values passed around the TAGE predictor and used to update the
* predictor state at commit.
* predictor state at commit
*
* @param fetch_width # instructions fetched
* @param num_tables ...
Expand Down Expand Up @@ -103,7 +103,7 @@ class TageResp(

/**
* Companion object to TageBrPredictor to get the the size of the
* BPD resp.
* branch predictor response.
*/
object TageBrPredictor
{
Expand Down Expand Up @@ -515,4 +515,3 @@ class TageBrPredictor(
(size_in_bits/1024) + " Kbits) (max history length: " + history_lengths.max + " bits)\n" +
tables.mkString("\n")
}

5 changes: 2 additions & 3 deletions src/main/scala/ifu/branch-checker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import boom.bpu._
import boom.common._

/**
* Combinational logic to verify that the BTB predicted correctly, choose BPD or
* BTB results, and catch JALs.
* Combinational logic to verify that the BoomBTB predicted correctly. This chooses
* between the BrPredictor or the BoomBTB. Also catch JALs.
*
* @param fetch_width # of instructions fetched
*/
Expand Down Expand Up @@ -154,4 +154,3 @@ class BranchChecker(fetch_width: Int)(implicit p: Parameters) extends BoomModule
+ (jal_idx << log2Ceil(fetchBytes))
+ Mux(io.is_rvc(jal_idx), 2.U, 4.U))
}

2 changes: 1 addition & 1 deletion src/main/scala/ifu/fetch-buffer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class FetchBufferResp(implicit p: Parameters) extends BoomBundle()(p)
}

/**
* Buffer to hold fetched packets and convert then into a vector of MicroOps
* Buffer to hold fetched packets and convert them into a vector of MicroOps
* to give the Decode stage
*
* @param num_entries effectively the number of full-sized fetch packets we can hold.
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/ifu/fetch-monitor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import boom.common._

/**
* A class to monitor a vector of MicroOps and their PCs and verify it is a valid sequence.
*
* NOTE: I should not be synthesized!
*/
class FetchMonitor(implicit p: Parameters) extends BoomModule()(p)
Expand Down Expand Up @@ -175,4 +176,3 @@ class FetchMonitor(implicit p: Parameters) extends BoomModule()(p)
last_valid := false.B
}
}

4 changes: 2 additions & 2 deletions src/main/scala/ifu/fetch-target-queue.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import boom.exu._
import boom.util._

/**
* Parameters used in configs for the FTQ
* FTQ Parameters used in configurations
*
* @param nEntries # of entries in the FTQ
*/
Expand Down Expand Up @@ -82,7 +82,7 @@ class GetPCFromFtqIO(implicit p: Parameters) extends BoomBundle()(p)
}

/**
* Queue to store the fetch PC and other relevant BPD signals that are inflight in the
* Queue to store the fetch PC and other relevant branch predictor signals that are inflight in the
* processor.
*
* @param num_entries # of entries in the FTQ
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/lsu/dcache-shim.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class LoadReqSlotIo(implicit p: Parameters) extends BoomBundle()(p)

/**
* Buffer entry tracking an inflight load memory request.
*
* Note: Anything incoming that gets killed by br or exception is still marked
* as "valid", since it also got sent to the datacache.
*/
Expand Down

0 comments on commit 5b355b0

Please sign in to comment.